Skip to content

TlsOptions Properties

Settings for how TLS connections are handled.

HandshakeTimeout

getset
View source
public TimeSpan HandshakeTimeout
Specifies the maximum amount of time allowed for the TLS/SSL handshake. This must be positive and finite.

LocalCertificate

getset
View source
public X509Certificate2 LocalCertificate

Specifies the local certificate used to authenticate TLS connections. This is ignored on server if LocalCertificateSelector is set.

To omit client authentication set to null on client and set TlsOptions to RemoteCertificateMode or RemoteCertificateMode on server.

If the certificate has an Extended Key Usage extension, the usages must include Server Authentication (OID 1.3.6.1.5.5.7.3.1) for server and Client Authentication (OID 1.3.6.1.5.5.7.3.2) for client.

LocalClientCertificateSelector

getset
View source
public Func<object, string, X509CertificateCollection, X509Certificate, string[], X509Certificate2> LocalClientCertificateSelector

A callback that will be invoked to dynamically select a local client certificate. This is higher priority than LocalCertificate.

If the certificate has an Extended Key Usage extension, the usages must include Client Authentication (OID 1.3.6.1.5.5.7.3.2).

LocalServerCertificateSelector

getset
View source
public Func<ConnectionContext, string, X509Certificate2> LocalServerCertificateSelector

A callback that will be invoked to dynamically select a local server certificate. This is higher priority than LocalCertificate. If SNI is not available then the name parameter will be null.

If the certificate has an Extended Key Usage extension, the usages must include Server Authentication (OID 1.3.6.1.5.5.7.3.1).

RemoteCertificateValidation

getset
View source
public RemoteCertificateValidator RemoteCertificateValidation
Specifies a callback for additional remote certificate validation that will be invoked during authentication. This will be ignored if TlsOptions is called after this callback is set.

SslProtocols

getset
View source
public SslProtocols SslProtocols
Specifies allowable SSL protocols. Defaults to System.Security.Authentication.SslProtocols.Tls13 and System.Security.Authentication.SslProtocols.Tls12.