Ssl |
[SerializableAttribute] public class SslHandshakeException : Exception
The SslHandshakeException type exposes the following members.
Name | Description | |
---|---|---|
SslHandshakeException | Initializes a new instance of the SslHandshakeException class. | |
SslHandshakeException(String) | Initializes a new instance of the SslHandshakeException class. | |
SslHandshakeException(SerializationInfo, StreamingContext) | Obsolete. Initializes a new instance of the SslHandshakeException class. | |
SslHandshakeException(String, Exception) | Initializes a new instance of the SslHandshakeException class. |
Name | Description | |
---|---|---|
Data | (Inherited from Exception) | |
HelpLink | (Inherited from Exception) | |
HResult | (Inherited from Exception) | |
InnerException | (Inherited from Exception) | |
Message | (Inherited from Exception) | |
RootCertificateAuthority | Get the certificate for the Root Certificate Authority. | |
ServerCertificate | Get the server's SSL certificate. | |
Source | (Inherited from Exception) | |
StackTrace | (Inherited from Exception) | |
TargetSite | (Inherited from Exception) |
Name | Description | |
---|---|---|
Equals | (Inherited from Object) | |
Finalize | (Inherited from Object) | |
GetBaseException | (Inherited from Exception) | |
GetHashCode | (Inherited from Object) | |
GetObjectData |
When overridden in a derived class, sets the SerializationInfo
with information about the exception.
(Overrides ExceptionGetObjectData(SerializationInfo, StreamingContext)) | |
GetType | (Inherited from Exception) | |
MemberwiseClone | (Inherited from Object) | |
ToString | (Inherited from Exception) |
Name | Description | |
---|---|---|
SerializeObjectState | (Inherited from Exception) |
The exception that is thrown when there is an error during the SSL/TLS handshake.
When this exception occurrs, it typically means that the IMAP, POP3 or SMTP server that you are connecting to is using an SSL certificate that is either expired or untrusted by your system.
Often times, mail servers will use self-signed certificates instead of using a certificate that has been signed by a trusted Certificate Authority. When your system is unable to validate the mail server's certificate because it is not signed by a known and trusted Certificate Authority, this exception will occur.
You can work around this problem by supplying a custom RemoteCertificateValidationCallback and setting it on the client's ServerCertificateValidationCallback property.
Most likely, you'll want to compare the thumbprint of the server's certificate with a known value and/or prompt the user to accept the certificate (similar to what you've probably seen web browsers do when they encounter untrusted certificates).