feat: add OcspMode enum, OcspConfig class, and wire into NatsOptions
Introduces NATS.Server.Tls.OcspMode (Auto/Always/Must/Never matching Go ocsp.go constants) and OcspConfig with Mode and OverrideUrls. Adds OcspConfig? and OcspPeerVerify to NatsOptions for stapling configuration and peer certificate revocation checking. Covered by 12 new unit tests.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System.Security.Authentication;
|
||||
using NATS.Server.Auth;
|
||||
using NATS.Server.Tls;
|
||||
|
||||
namespace NATS.Server;
|
||||
|
||||
@@ -85,5 +86,9 @@ public sealed class NatsOptions
|
||||
public HashSet<string>? TlsPinnedCerts { get; set; }
|
||||
public SslProtocols TlsMinVersion { get; set; } = SslProtocols.Tls12;
|
||||
|
||||
// OCSP stapling and peer verification
|
||||
public OcspConfig? OcspConfig { get; set; }
|
||||
public bool OcspPeerVerify { get; set; }
|
||||
|
||||
public bool HasTls => TlsCert != null && TlsKey != null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user