#[non_exhaustive]pub enum TlsError {
ClosedWithoutNotify,
InappropriateHandshakeMessage,
InitialConnect(Error, ServerName<'static>, u16),
NoResponse,
Open(Error),
Receive(Error),
Send(Error),
ServerCertificate(CertificateError),
ShutdownFailed(Error),
TimedOut(ServerName<'static>, u16, Duration),
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ClosedWithoutNotify
The server closed the connection before sending close_notify.
This could mean an attacker caused a premature closure and the
message was truncated, or the remote server simply forgot to
send the alert. [RFC 8446 § 6.1]
Erroring out when close_notify is missing is comparable to
cURL’s behavior with HTTP/1.1 over TLS. Like HTTP/1.1, the
Gemini network protocol does not have any way of indicating
beforehand how much data the client should expect, so
close_notify is its only mechanism for informing the client
that transmission is complete and that data was not truncated,
before closing the socket. [curl#4427], [curl#11586], [curl/TODO]
InappropriateHandshakeMessage
Received an inappropriate handshake message from the server.
InitialConnect(Error, ServerName<'static>, u16)
Failed to connect to the remote.
NoResponse
The server replied with nothing, or didn’t reply at all.
Open(Error)
Failed to open a TCP socket.
Receive(Error)
Failed to read data from the server.
Send(Error)
Failed to send data to the server.
ServerCertificate(CertificateError)
Could not read or validate the certificate.
ShutdownFailed(Error)
Failed to shut down the TCP connection.
TimedOut(ServerName<'static>, u16, Duration)
Timed out while opening a socket or awaiting a response.
Trait Implementations§
Source§impl Error for TlsError
impl Error for TlsError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()