mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
Updates based on code review
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
This commit is contained in:
@@ -334,6 +334,8 @@ func (srv *Server) NewOCSPMonitor(config *tlsConfigKind) (*tls.Config, *OCSPMoni
|
||||
// NOTE: Currently OCSP Stapling is enabled only for the first certificate found.
|
||||
var mon *OCSPMonitor
|
||||
for _, cert := range tc.Certificates {
|
||||
// This is normally non-nil, but can still be nil here when in tests
|
||||
// or in some embedded scenarios.
|
||||
if cert.Leaf == nil {
|
||||
if len(cert.Certificate) <= 0 {
|
||||
return nil, nil, fmt.Errorf("no certificate found")
|
||||
|
||||
@@ -2439,7 +2439,7 @@ func getOCSPStatus(s tls.ConnectionState) (*ocsp.Response, error) {
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
func TestOCSPManualConfig(t *testing.T) {
|
||||
func TestOCSPTLSConfigNoLeafSet(t *testing.T) {
|
||||
o := DefaultTestOptions
|
||||
o.HTTPHost = "127.0.0.1"
|
||||
o.HTTPSPort = -1
|
||||
|
||||
Reference in New Issue
Block a user