tlslite.errors module

Exception classes.

exception tlslite.errors.BaseTLSException

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

Bases: tlslite.errors.EncryptionError

An error appeared while encoding

exception tlslite.errors.EncryptionError

Bases: tlslite.errors.BaseTLSException

Base class for exceptions thrown while encrypting.

exception tlslite.errors.InvalidSignature

Bases: tlslite.errors.EncryptionError

Verification function found invalid signature

exception tlslite.errors.MaskTooLongError

Bases: tlslite.errors.EncryptionError

The maskLen passed into function is too high

exception tlslite.errors.MessageTooLongError

Bases: tlslite.errors.EncryptionError

The message passed into function is too long

exception tlslite.errors.TLSAbruptCloseError

Bases: tlslite.errors.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

Bases: tlslite.errors.TLSError

A TLS alert has been signalled.

exception tlslite.errors.TLSAuthenticationError

Bases: tlslite.errors.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

Bases: tlslite.errors.TLSAuthenticationError

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

exception tlslite.errors.TLSAuthorizationError

Bases: tlslite.errors.TLSAuthenticationError

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

exception tlslite.errors.TLSBadRecordMAC

Bases: tlslite.errors.TLSProtocolException

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

exception tlslite.errors.TLSClosedConnectionError

Bases: tlslite.errors.TLSError, OSError

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

exception tlslite.errors.TLSDecodeError

Bases: tlslite.errors.TLSProtocolException

The received message encoding does not match specification.

exception tlslite.errors.TLSDecryptionFailed

Bases: tlslite.errors.TLSProtocolException

Decryption of data was unsuccessful

exception tlslite.errors.TLSError

Bases: tlslite.errors.BaseTLSException

Base class for all TLS Lite exceptions.

__str__()

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

exception tlslite.errors.TLSFaultError

Bases: tlslite.errors.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

Bases: tlslite.errors.TLSAuthenticationError

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

exception tlslite.errors.TLSHandshakeFailure

Bases: tlslite.errors.TLSProtocolException

Could not find acceptable set of handshake parameters

exception tlslite.errors.TLSIllegalParameterException

Bases: tlslite.errors.TLSProtocolException

Parameters specified in message were incorrect or invalid

exception tlslite.errors.TLSInsufficientSecurity

Bases: tlslite.errors.TLSProtocolException

Parameters selected by user are too weak

exception tlslite.errors.TLSInternalError

Bases: tlslite.errors.TLSError

The internal state of object is unexpected or invalid.

Caused by incorrect use of API.

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

Bases: tlslite.errors.TLSAlert

A TLS alert has been signalled by the local implementation.

Variables:
__init__(alert, message=None)

Initialize self. See help(type(self)) for accurate signature.

__str__()

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

exception tlslite.errors.TLSNoAuthenticationError

Bases: tlslite.errors.TLSAuthenticationError

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

exception tlslite.errors.TLSProtocolException

Bases: tlslite.errors.BaseTLSException

Exceptions used internally for handling errors in received messages

exception tlslite.errors.TLSRecordOverflow

Bases: tlslite.errors.TLSProtocolException

The received record size was too big

exception tlslite.errors.TLSRemoteAlert(alert)

Bases: tlslite.errors.TLSAlert

A TLS alert has been signalled by the remote implementation.

Variables:
__init__(alert)

Initialize self. See help(type(self)) for accurate signature.

__str__()

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

exception tlslite.errors.TLSUnknownPSKIdentity

Bases: tlslite.errors.TLSProtocolException

The PSK or SRP identity is unknown

exception tlslite.errors.TLSUnsupportedError

Bases: tlslite.errors.TLSError

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

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

Bases: tlslite.errors.TLSAuthenticationError

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

__init__(msg, info=None)

Initialize self. See help(type(self)) for accurate signature.

exception tlslite.errors.UnknownRSAType

Bases: tlslite.errors.EncryptionError

Unknown RSA algorithm type passed