Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read system certs directly from /etc/ssl #12541

Merged
merged 1 commit into from
Nov 22, 2023

Conversation

masnax
Copy link
Contributor

@masnax masnax commented Nov 21, 2023

If LXD failed to pick up system certs from /etc/ssl via x509.SystemCertPool (https://pkg.go.dev/crypto/x509#SystemCertPool and https://cs.opensource.google/go/go/+/master:src/crypto/x509/root_linux.go) then it would try to read /var/lib/snapd/hostfs/etc/ssl, which is itself symlinked to /etc/ssl in the LXD snap confinement.

As of https://forum.snapcraft.io/t/custom-certificate-support/28168, snaps should be able to read /etc/ssl directly, so this makes the second check redundant. Additionally, any other snap using ConnectLXD should be able to read the system certs as well, though they may fail to read /var/lib/snapd/hostfs.

@simondeziel
Copy link
Member

simondeziel commented Nov 21, 2023

@masnax
Copy link
Contributor Author

masnax commented Nov 22, 2023

@masnax I think that https://pkg.go.dev/crypto/x509#SystemCertPool and https://cs.opensource.google/go/go/+/master:src/crypto/x509/root_linux.go suggest that this is already done by default. Same for Windows but a bit more opaque https://cs.opensource.google/go/go/+/master:src/crypto/x509/root_windows.go

Hm, in that case the whole block was always redundant.

@tomponline tomponline merged commit af38cb1 into canonical:main Nov 22, 2023
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants