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.
Constructing an
X509Certificate2
instance for a p12 file is problematic. The private key gets stored in a temp file, which is discarded when theX509Certificate2
instance is disposed. That causes problems for us, as the public key material is in our store, but the private key no longer exists on disk.Instead of instantiating, we should store the certificate in the OS store, and load the cert that we need from there.
Also, the test certs that were checked in were generated with mkcert. We can't share those certs, because a distinct mkcert root certificate is generated on each developer's machine. This means that the identity server test certificates I generate won't be trusted by another machine, unless it also trusts my mkcert root certificate. And we won't do that, because it would give me the power to create fraudulent certificates that other dev's machines would trust. Instead, we just remove the test certs from source control and have a comment in the source to use mkcert and add the certs to the OS store. The manual signing credentials are not used by default, so this seems like an acceptable compromise.