TlsOptions
TLS options and trust/identity verification.
Client creates a verified client. Defaults use standard trusted CAs and the connection hostname. A supplied trustedChain replaces the default set for that connection; commonNameOverride sets another expected identity.
ClientUnsafe disables name verification and, without trustedChain, mandatory chain trust verification too. That does not repair an incorrect certificate. Server needs a matching private key/certificate; clients do not need the server private key. Check TLS availability and target-platform trust behavior separately.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Methods9
ClientTlsOptions
public static TlsOptions Client(X509Certificate trustedChain = null, string commonNameOverride = "");Creates a verified TLS client. trustedChain replaces the default trust set; an empty commonNameOverride retains the connection identity.
| Name | Type | Default |
|---|---|---|
trustedChain | X509Certificate | null |
commonNameOverride | string | "" |
TlsOptionsClientUnsafeTlsOptions
public static TlsOptions ClientUnsafe(X509Certificate trustedChain = null);Disables server-name verification. Without trustedChain also disables mandatory chain trust verification. Do not use as a certificate repair.
| Name | Type | Default |
|---|---|---|
trustedChain | X509Certificate | null |
TlsOptionsGetCommonNameOverridestring
public string GetCommonNameOverride();The expected identity overriding the connection name; empty retains the connection name. Not evidence that certificate verification succeeded.
stringGetOwnCertificateX509Certificate
public X509Certificate GetOwnCertificate();Returns the X509Certificate specified when creating with TlsOptions.Server.
X509CertificateGetPrivateKeyCryptoKey
public CryptoKey GetPrivateKey();Returns the CryptoKey specified when creating with TlsOptions.Server.
CryptoKeyGetTrustedCaChainX509Certificate
public X509Certificate GetTrustedCaChain();Returns the CA X509Certificate chain specified when creating with TlsOptions.Client or TlsOptions.ClientUnsafe.
X509CertificateIsServerbool
public bool IsServer();Returns true if created with TlsOptions.Server, false otherwise.
boolIsUnsafeClientbool
public bool IsUnsafeClient();Returns true if created with TlsOptions.ClientUnsafe, false otherwise.
boolServerTlsOptions
public static TlsOptions Server(CryptoKey key, X509Certificate certificate);Creates a TLS server configuration using the provided key and certificate.
Note: The certificate should include the full certificate chain up to the signing CA (certificates file can be concatenated using a general purpose text editor).
| Name | Type | Default |
|---|---|---|
key | CryptoKey | — |
certificate | X509Certificate | — |
TlsOptions