tlslite.errors module

Exception classes.

exception tlslite.errors.BaseTLSException[source]

Bases: Exception

Metaclass for TLS Lite exceptions.

Look to tlslite.errors.TLSError for exceptions that should be caught by tlslite consumers

exception tlslite.errors.EncodingError[source]

Bases: EncryptionError

An error appeared while encoding

exception tlslite.errors.EncryptionError[source]

Bases: BaseTLSException

Base class for exceptions thrown while encrypting.

exception tlslite.errors.InvalidSignature[source]

Bases: EncryptionError

Verification function found invalid signature

exception tlslite.errors.MaskTooLongError[source]

Bases: EncryptionError

The maskLen passed into function is too high

exception tlslite.errors.MessageTooLongError[source]

Bases: EncryptionError

The message passed into function is too long

exception tlslite.errors.TLSAbruptCloseError[source]

Bases: TLSError

The socket was closed without a proper TLS shutdown.

The TLS specification mandates that an alert of some sort must be sent before the underlying socket is closed. If the socket is closed without this, it could signify that an attacker is trying to truncate the connection. It could also signify a misbehaving TLS implementation, or a random network failure.

exception tlslite.errors.TLSAlert[source]

Bases: TLSError

A TLS alert has been signalled.

exception tlslite.errors.TLSAuthenticationError[source]

Bases: TLSError

The handshake succeeded, but the other party’s authentication was inadequate.

This exception will only be raised when a tlslite.Checker.Checker has been passed to a handshake function. The Checker will be invoked once the handshake completes, and if the Checker objects to how the other party authenticated, a subclass of this exception will be raised.

exception tlslite.errors.TLSAuthenticationTypeError[source]

Bases: TLSAuthenticationError

The Checker was expecting the other party to authenticate with a different type of certificate chain.

exception tlslite.errors.TLSAuthorizationError[source]

Bases: TLSAuthenticationError

The Checker was expecting the other party to authenticate with a certificate chain that has a different authorization.

exception tlslite.errors.TLSBadRecordMAC[source]

Bases: TLSProtocolException

Bad MAC (or padding in case of mac-then-encrypt)

exception tlslite.errors.TLSClosedConnectionError[source]

Bases: TLSError, OSError

An attempt was made to use the connection after it was closed.

exception tlslite.errors.TLSDecodeError[source]

Bases: TLSProtocolException

The received message encoding does not match specification.

exception tlslite.errors.TLSDecryptionFailed[source]

Bases: TLSProtocolException

Decryption of data was unsuccessful

exception tlslite.errors.TLSError[source]

Bases: BaseTLSException

Base class for all TLS Lite exceptions.

__str__()[source]

At least print out the Exception time for str(…).

exception tlslite.errors.TLSFaultError[source]

Bases: TLSError

The other party responded incorrectly to an induced fault.

This exception will only occur during fault testing, when a tlslite.tlsconnection.TLSConnection’s fault variable is set to induce some sort of faulty behavior, and the other party doesn’t respond appropriately.

exception tlslite.errors.TLSFingerprintError[source]

Bases: TLSAuthenticationError

The Checker was expecting the other party to authenticate with a certificate chain that matches a different fingerprint.

exception tlslite.errors.TLSHandshakeFailure[source]

Bases: TLSProtocolException

Could not find acceptable set of handshake parameters

exception tlslite.errors.TLSIllegalParameterException[source]

Bases: TLSProtocolException

Parameters specified in message were incorrect or invalid

exception tlslite.errors.TLSInsufficientSecurity[source]

Bases: TLSProtocolException

Parameters selected by user are too weak

exception tlslite.errors.TLSInternalError[source]

Bases: TLSError

The internal state of object is unexpected or invalid.

Caused by incorrect use of API.

exception tlslite.errors.TLSLocalAlert(alert, message=None)[source]

Bases: TLSAlert

A TLS alert has been signalled by the local implementation.

Variables:
__init__(alert, message=None)[source]
__str__()[source]

At least print out the Exception time for str(…).

exception tlslite.errors.TLSNoAuthenticationError[source]

Bases: TLSAuthenticationError

The Checker was expecting the other party to authenticate with a certificate chain, but this did not occur.

exception tlslite.errors.TLSProtocolException[source]

Bases: BaseTLSException

Exceptions used internally for handling errors in received messages

exception tlslite.errors.TLSRecordOverflow[source]

Bases: TLSProtocolException

The received record size was too big

exception tlslite.errors.TLSRemoteAlert(alert)[source]

Bases: TLSAlert

A TLS alert has been signalled by the remote implementation.

Variables:
__init__(alert)[source]
__str__()[source]

At least print out the Exception time for str(…).

exception tlslite.errors.TLSUnexpectedMessage[source]

Bases: TLSProtocolException

The received message was unexpected or parsing of Inner Plaintext failed

exception tlslite.errors.TLSUnknownPSKIdentity[source]

Bases: TLSProtocolException

The PSK or SRP identity is unknown

exception tlslite.errors.TLSUnsupportedError[source]

Bases: TLSError

The implementation doesn’t support the requested (or required) capabilities.

exception tlslite.errors.TLSValidationError(msg, info=None)[source]

Bases: TLSAuthenticationError

The Checker has determined that the other party’s certificate chain is invalid.

__init__(msg, info=None)[source]
exception tlslite.errors.UnknownRSAType[source]

Bases: EncryptionError

Unknown RSA algorithm type passed