Closed sunjayBhatia closed 4 years ago
cc @n4wei
I don't believe that we have an existing track of work for this. The package was written for the CLI so thread-safety wasn't originally a concern. It would be nice to fix this though.
I think this is now fixed with the removal of global variables in https://github.com/square/certstrap/commit/8cbba964811bfc0d1532896669d3430758d897f7?
Yes, the global state has been removed in #77 and the change was part of the 1.2.0 release.
We are using some of the functions in the
pkix
package to generate CAs, certs, and keys in tests. Running the tests with race detection and in parallel triggered failures as there are package level variables that are written to by different goroutines:The
pkix
package seems to use a pattern that makes its functions unsafe for concurrent use, e.g. https://github.com/square/certstrap/blob/a0ea37d7c3834c63c247ab2083acf9d4657b19cd/pkix/cert_auth.go#L85Is there an existing track of work to ensure the
pkix
package is safe for concurrency?