-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
crypto/x509: add ability to reload root certificates #41888
Comments
Related to #35887 |
I'd like to see this issue moving forward as this is directly affecting developer's ability to react to changes in the system's certificate pool. Is there any interest in a contribution here? I do fancy the original posts' idea of the addition of a
|
Change https://golang.org/cl/327069 mentions this issue: |
This is a workaround for Golang's missing feature of reloading system certs. The built in system certs pool is initialized only once on startup and there is no option for reloading it when new certs are installed. The problem is known upstream and tracked at golang/go#41888. The cert_pool.go is almost 1:1 copy of original library code but exposes needed functionality. It can be removed when upstream fixes the problem.
The code also loads all the certificates into memory at once, which may be suboptimal for embedded applications. Certificate root directories usually enable lookup by hash, which would be sufficient for a large number of applications. |
Problem description:
As it can be seen on this line, root certificates loaded only once during the lifetime of the application -
go/src/crypto/x509/root.go
Line 16 in 9e5b136
This creates a problem when new root certificates are added. In our case, it happens on a regular basis when clients add intermediate/root certificates to the system via a separate component and then all other components that run in separate processes are expected to make use of them. This is currently not possible.
Workaround:
We are currently re-implemented Root Certificate loading logic by cutting and pasting the code from this library into our codebase and create our own certPool() for every request that requires the ca-chain refresh.
Proposed solutions:
The text was updated successfully, but these errors were encountered: