This repository was archived by the owner on Sep 30, 2024. It is now read-only.
gitserver: include system certificates for git#41253
Merged
Merged
Conversation
This is to make it possible to review what we have changed as a commit.
When specifying certificates for tls.external site configuration we adjust the TLS configuration for go and git. In the case of go we would respect both the certificates specified as well as the system certificate authorities. For git we would only respect the custom certificates. This lead to customers either including system certificates in the site configuration, or baking in the custom certificates into our docker images. We now will include system certificates for git if running on linux. Given we deploy on Linux this is fine. It isn't possible to support all operating systems, since not all OSs expose certificates. For example darwin does not. This is also why the x509 package in go doesn't expose system certificates, since it can't do it cross platform. As such we introduce the cacert package which is a modification the x509 to expose the system certificates on Linux. Test Plan: modified unit tests to output the certificate, validated the certificate included the system certifications. Additionally validated the code did not error on non-linux systems.
Contributor
|
Codenotify: Notifying subscribers in CODENOTIFY files for diff 25cda22...53ca808.
|
sfllaw
reviewed
Sep 2, 2022
sfllaw
reviewed
Sep 2, 2022
Co-authored-by: Simon Law <sfllaw@sfllaw.ca>
Member
Author
|
@sourcegraph/repo-management ping |
LawnGnome
approved these changes
Sep 8, 2022
LawnGnome
left a comment
Contributor
There was a problem hiding this comment.
LGTM, after reviewing in conjunction with the relevant bits of the upstream crypto/x509 code.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When specifying certificates for tls.external site configuration we adjust the TLS configuration for go and git. In the case of go we would respect both the certificates specified as well as the system certificate authorities. For git we would only respect the custom certificates. This lead to customers either including system certificates in the site configuration, or baking in the custom certificates into our docker images.
We now will include system certificates for git if running on linux. Given we deploy on Linux this is fine. It isn't possible to support all operating systems, since not all OSs expose certificates. For example darwin does not. This is also why the x509 package in go doesn't expose system certificates, since it can't do it cross platform.
As such we introduce the cacert package which is a modification the x509 to expose the system certificates on Linux.
Test Plan: modified unit tests to output the certificate, validated the certificate included the system certifications. Additionally validated the code did not error on non-linux systems.
Fixes https://github.com/sourcegraph/sourcegraph/issues/38128
Fixes https://github.com/sourcegraph/customer/issues/1136