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

Fixed local issuer determination for OCSP Staple, issue #3773 #4355

Merged
merged 2 commits into from Aug 1, 2023

Conversation

tbeets
Copy link
Contributor

@tbeets tbeets commented Aug 1, 2023

Resolves problems of issue #3773.

With this fix, NATS Server will locally determine it's own certificate's issuer from either the configured server certificate (bundle of leaf cert plus optional intermediate CA certs) or from the configured server CA trust store, as follows:

  1. The operator may provide the server's certificate issuer in the second position of the server's certificate configuration (typically cert_file but may be cert_store on the Windows platform). If a candidate issuer is found here it is PKI validated as the actual issuer of the server's cert else a hard error.

  2. If not found in [1], NATS Server will seek to create at least one verified chain with its configured trust store (typically ca_file but could by the system trust store if not configured). It will derive the issuer from the first verified chain. If no verified chain can be formed it is a hard error.

@tbeets tbeets requested a review from a team as a code owner August 1, 2023 21:49
@tbeets
Copy link
Contributor Author

tbeets commented Aug 1, 2023

This fix also includes unit tests that verifies that both OCSP Staple and OCSP Peer features can be configured and used concurrently.

serverCert := "configs/certs/ocsp_peer/mini-ca/server1/TestServer1_cert.pem"

var (
// errExpectedNoStaple = fmt.Errorf("expected no staple")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leftover comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. Fixed.

Copy link
Member

@wallyqs wallyqs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@tbeets tbeets merged commit 971c616 into dev Aug 1, 2023
2 checks passed
@tbeets tbeets deleted the tgb/ocsp-staple-3773 branch August 1, 2023 23:13
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.

None yet

2 participants