Table of Contents

Enum SslError

Namespace
System.Net.Sockets
Assembly
System.Net.dll

Defines error codes returned by native SSL initialisation.

public enum SslError : byte

Fields

CertificateParseFailed = 7

The supplied certificate could not be parsed. Verify the certificate is in a supported format (PEM or DER) and is not corrupted.

ConfigDefaultsFailed = 4

Setting TLS configuration defaults failed. This is an internal mbedTLS error that should not occur under normal conditions.

DrbgSeedFailed = 3

The DRBG (Deterministic Random Bit Generator) seed step failed. The entropy source could not be initialised.

HandshakeBadContext = 10

The SSL context was not valid when attempting the handshake. Thrown as InvalidOperationException.

HandshakeCertVerifyFailed = 12

Certificate verification failed during the handshake. Thrown as CryptographicException with ErrorCode set to the bitmask of MBEDTLS_X509_BADCERT_* verification flags returned by mbedtls_ssl_get_verify_result().

HandshakeFailed = 13

The TLS handshake failed. Thrown as CryptographicException with ErrorCode set to the raw negative mbedTLS error code.

HandshakeSetHostname = 11

Setting the server hostname for SNI failed during the handshake. Thrown as InvalidOperationException.

NoFreeContext = 1

All SSL context slots are in use. Close an existing SSL connection before opening a new one.

None = 0

No error; SSL context initialisation succeeded.

OutOfMemory = 2

A memory allocation failed while setting up the SSL context. The device may be low on heap.

OwnCertConfigFailed = 8

Configuring the own certificate and private key pair on the SSL context failed. This is an internal mbedTLS error that should not occur under normal conditions.

PrivateKeyParseFailed = 6

The supplied private key could not be parsed. Verify the key is in a supported format (PEM or DER) and is not corrupted.

SetupFailed = 9

Final SSL context setup failed. This is an internal mbedTLS error that should not occur under normal conditions.

UnsupportedProtocolVersion = 5

The requested TLS protocol version is not supported on this device. Use a protocol version that the target hardware supports.

Remarks

Values are kept in sync with the SSL_Error enum in the native interpreter (ssl_functions.h). SslStream surfaces these through ErrorCode when SSL context setup fails.