Skip to content
Snippets Groups Projects

Use certutil to create certificate chain for Git

Merged Elliot Rushton requested to merge use-certutil into master
4 unresolved threads

What does this MR do?

Uses certUtil library to pull the complete certificate chain - which doesn't happen by default in newer Go versions.

Why was this MR needed?

Because without all the certs we can't upgrade from Go 1.8.7

Are there points in the code the reviewer needs to double check?

Does this MR meet the acceptance criteria?

  • Documentation created/updated
  • Added tests for this feature/bug
  • In case of conflicts with master - branch was rebased

What are the relevant issue numbers?

Closes #4019 (closed)

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
659 667 pruneopts = "N"
660 668 revision = "cfb38830724cc34fedffe9a2a29fb54fa9169cd1"
661 669
670 [[projects]]
671 digest = "1:59e2776740eed3c71fdff7cf591c9401d69588607b0ab3fe2239005d8ca5ab33"
672 name = "github.com/zakjan/cert-chain-resolver"
  • This dependency should be added to Gopkg.toml :)

  • Author Developer

    Yeah I don't know how I missed that part.

    Is that the only feedback? :smiley:

  • Yes, for now :). I think we should extend the test project to test also Go 1.13 (recently released, so current 'stable'). And the comparisons should also show comparison for all tested versions vs. 1.8.

    But the change in Runner's code is pretty straightforward - there is not much to review here :).

    Let's just test this good. For example we could install a Runner built with this change and on Go 1.9 on one (or maybe even both) of our private Runners and leave it for a while to see if it works properly. If yes, then I think we can proceed, and merge this into master. The chains created by Go 1.9+ with this update seem to be identical to the one from Go 1.8. So I expect we may get more problems from upgrading Go to 1.10+ than from this MR :wink:

  • Author Developer

    Pipeline updated with Go 1.13 (and 1.11 for completion) https://gitlab.com/erushton/go-lang-tls-connection-state/pipelines/82769582

    *Edited - I previously posted the wrong link

    Edited by Elliot Rushton
  • Please register or sign in to reply
  • Elliot Rushton added 1 commit

    added 1 commit

    Compare with previous version

  • @erushton I've double tested it, using the updates to the test project that I've prepared few months ago (adding them on top of your recent changes) - https://gitlab.com/tmaczukin-test-projects/go-lang-tls-connection-state/pipelines/82798163. github.com/zakjan/cert-chain-resolver/certUtil seems to do the trick: while with Go 1.9+ we receive a shorter certificates chain with the HTTP response struct, the final certificates chain, created by certUtil is identical to what we have currently with Go 1.8 by default.

    I'd say that this resolves our problem :).

    Let's prepare a binaries built with Go 1.9.x. Then we can ask the reporters from #3183 (closed), who discovered the problem with Runner on Go 1.9, to check if new binaries are working properly :)

    For that I've created a temporary branch that will create a test binary basing on this MR and Go 1.9.7. The binaries will be available at: https://gitlab-runner-downloads.s3.amazonaws.com/test-certutil-with-go-1-9/index.html after the https://gitlab.com/gitlab-org/gitlab-runner/pipelines/82802362 Pipeline will succeed.

    As for this MR we should do one thing: cleanup the commits history. @erushton Please rebase the commits to have two of them:

    1. First one, that adds the dependency (including the Gopkg.toml, Gopkg.lock and vendor/ changes).
    2. Second one, that adds the change in the Runner's code at network/client.go.

    I'd also think about adding here a test based on the idea of our go-lang-tls-connection-state project, that would detect it the certificates chain would be changed from what is expected.

  • mentioned in issue #3183 (closed)

  • I've asked the users who reported the problem with Go 1.9 in #3183 (closed) to test the new binaries. Let's wait and see if they are able to help us validate the fixed version compiled with Go 1.9.7 :)

  • Elliot Rushton added 2 commits

    added 2 commits

    • d597c276 - Add certUtil dependency
    • 8ca39fd8 - Use certUtil to get certificate chain

    Compare with previous version

  • Elliot Rushton unmarked as a Work In Progress

    unmarked as a Work In Progress

  • Elliot Rushton changed the description

    changed the description

  • Elliot Rushton mentioned in issue #4722

    mentioned in issue #4722

  • Author Developer

    @tmaczukin I've rebased and put them into 2 commits as you suggested and opened #4722 to track adding a consistent test.

    Assigning to you for review/merge :smiley:

  • @erushton As the failing job tells use, you need to Go fmt the code:

    go fmt network/client.go

    And then amend the last commit and force-push the branch :wink:

  • Tomasz Maczukin assigned to @erushton and unassigned @tmaczukin

    assigned to @erushton and unassigned @tmaczukin

  • Author Developer

    sigh

  • Elliot Rushton added 1 commit

    added 1 commit

    • b7827702 - Use certUtil to get certificate chain

    Compare with previous version

  • Elliot Rushton assigned to @tmaczukin and unassigned @erushton

    assigned to @tmaczukin and unassigned @erushton

  • Let's wait with merging this to Monday. I'll then find the old MR that was upgrading the Go version to 1.9 (and that we've reverted), I'll update it and then we can merge both :)

  • Author Developer

    Sounds good to me :man_dancing:

  • changed milestone to %12.4

  • mentioned in issue #3202 (closed)

  • Tomasz Maczukin mentioned in merge request !1337 (closed)

    mentioned in merge request !1337 (closed)

  • Awesome! Nice work @erushton. :)

  • Woohoo, this is awesome!

  • mentioned in merge request !1594 (merged)

  • mentioned in merge request !1601 (merged)

  • Tomasz Maczukin changed the description

    changed the description

  • Tomasz Maczukin approved this merge request

    approved this merge request

  • OK, time to merge this. Thank you @erushton for the solution! :)

  • Tomasz Maczukin mentioned in commit 2f2bd1d5

    mentioned in commit 2f2bd1d5

  • mentioned in issue #2947 (closed)

  • Waahoooo!! what a way to start a week!

  • Steve Xuereb - Out of Office Back 2025-04-21 changed title from Use certutil to Use certutil to create certificate chain for Git

    changed title from Use certutil to Use certutil to create certificate chain for Git

  • changed the description

  • Tomasz Maczukin mentioned in merge request !1639 (merged)

    mentioned in merge request !1639 (merged)

  • mentioned in issue #4805 (closed)

  • Tomasz Maczukin mentioned in issue #4890

    mentioned in issue #4890

  • Stan Hu mentioned in commit c613d048

    mentioned in commit c613d048

  • Stan Hu mentioned in merge request !3699 (merged)

    mentioned in merge request !3699 (merged)

  • Stan Hu mentioned in commit ed980ae9

    mentioned in commit ed980ae9

  • Stan Hu mentioned in commit 5bb4e54a

    mentioned in commit 5bb4e54a

  • Stan Hu mentioned in commit fc64dad2

    mentioned in commit fc64dad2

  • Stan Hu mentioned in commit 7bb47a26

    mentioned in commit 7bb47a26

  • Stan Hu mentioned in commit f4862401

    mentioned in commit f4862401

  • Stan Hu mentioned in commit fa2d557d

    mentioned in commit fa2d557d

  • Stan Hu mentioned in commit b9e7341a

    mentioned in commit b9e7341a

  • Stan Hu mentioned in commit 55703cc2

    mentioned in commit 55703cc2

  • Please register or sign in to reply
    Loading