Tests for twisted.internet._sslverify
.
Function | counter | Each time we're called, return the next integer in the natural numbers. |
Function | makeCertificate | Undocumented |
Function | certificatesForAuthorityAndServer | Create a self-signed CA certificate and server certificate signed by the CA. |
Function | loopbackTLSConnection | Create a loopback TLS connection with the given trust and keys. |
Function | loopbackTLSConnectionInMemory | Create a loopback TLS connection with the given trust and keys. Like loopbackTLSConnection ,
but using in-memory certificates and keys rather than writing them to
disk. |
Function | pathContainingDumpOf | Create a temporary file to store some serializable-as-PEM objects in, and return its name. |
Class | DataCallbackProtocol | Undocumented |
Class | WritingProtocol | Undocumented |
Class | FakeContext | Introspectable fake of an OpenSSL.SSL.Context . |
Class | ClientOptionsTests | Tests for sslverify.optionsForClientTLS . |
Class | FakeChooseDiffieHellmanEllipticCurve | A fake implementation of _ChooseDiffieHellmanEllipticCurve |
Class | OpenSSLOptionsTestsMixin | A mixin for OpenSSLOptions test cases creates client and
server certificates, signs them with a CA, and provides a loopback
that creates TLS a connections with them. |
Class | OpenSSLOptionsTests | Tests for sslverify.OpenSSLOptions . |
Class | OpenSSLOptionsECDHIntegrationTests | ECDH-related integration tests for OpenSSLOptions . |
Class | DeprecationTests | Tests for deprecation of sslverify.OpenSSLCertificateOptions 's
support of the pickle protocol. |
Class | TrustRootTests | Tests for sslverify.OpenSSLCertificateOptions '
trustRoot argument, sslverify.platformTrust ,
and their interactions. |
Class | ServiceIdentityTests | Tests for the verification of the peer's service's identity via the
hostname argument to sslverify.OpenSSLCertificateOptions . |
Function | negotiateProtocol | Create the TLS connection and negotiate a next protocol. |
Class | NPNOrALPNTests | NPN and ALPN protocol selection. |
Class | ALPNTests | ALPN protocol selection. |
Class | NPNAndALPNAbsentTests | NPN/ALPN operations fail on platforms that do not support them. |
Class | ConstructorsTests | No class docstring; 6/6 methods documented |
Class | MultipleCertificateTrustRootTests | Test the behavior of the trustRootFromCertificates() API call. |
Class | OpenSSLCipherTests | Tests for twisted.internet._sslverify.OpenSSLCipher. |
Class | ExpandCipherStringTests | Tests for twisted.internet._sslverify._expandCipherString. |
Class | AcceptableCiphersTests | Tests for twisted.internet._sslverify.OpenSSLAcceptableCiphers. |
Class | DiffieHellmanParametersTests | Tests for twisted.internet._sslverify.OpenSSLDHParameters. |
Class | FakeLibState | State for FakeLib |
Class | FakeLib | An introspectable fake of cryptography's lib object. |
Class | FakeLibTests | Tests for FakeLib . |
Class | FakeCryptoState | State for FakeCrypto |
Class | FakeCrypto | An introspectable fake of pyOpenSSL's OpenSSL.crypto
module. |
Class | FakeCryptoTests | Tests for FakeCrypto . |
Class | ChooseDiffieHellmanEllipticCurveTests | Tests for sslverify._ChooseDiffieHellmanEllipticCurve . |
Class | KeyPairTests | Tests for sslverify.KeyPair . |
Class | SelectVerifyImplementationTests | Tests for _selectVerifyImplementation . |
Function | _loopbackTLSConnection | Common implementation code for both loopbackTLSConnection
and loopbackTLSConnectionInMemory .
Creates a loopback TLS connection using the provided server and client
context factories. |
Class | _NotSSLTransport | Undocumented |
Class | _MaybeSSLTransport | Undocumented |
Class | _ActualSSLTransport | Undocumented |
Each time we're called, return the next integer in the natural numbers.
Create a self-signed CA certificate and server certificate signed by the CA.
Parameters | serviceIdentity | The identity (hostname) of the server. (type: unicode ) |
Returns | a 2-tuple of (certificate_authority_certificate,
server_certificate) (type: tuple
of (sslverify.Certificate ,
sslverify.PrivateCertificate )) |
Common implementation code for both loopbackTLSConnection
and loopbackTLSConnectionInMemory
.
Creates a loopback TLS connection using the provided server and client
context factories.
Parameters | serverOpts | An OpenSSL context factory for the server. (type: OpenSSLCertificateOptions , or any class with an equivalent
API.) |
clientOpts | An OpenSSL context factory for the client. (type: OpenSSLCertificateOptions , or any class with an equivalent
API.) | |
Returns | 5-tuple of server-tls-protocol, server-inner-protocol, client-tls-protocol,
client-inner-protocol and IOPump (type: tuple ) |
Create a loopback TLS connection with the given trust and keys.
Parameters | trustRoot | the trustRoot argument for the client connection's context. (type: sslverify.IOpenSSLTrustRoot ) |
privateKeyFile | The name of the file containing the private key. (type: str
(native string; file name)) | |
chainedCertFile | The name of the chained certificate file. (type: str
(native string; file name)) | |
Returns | 3-tuple of server-protocol, client-protocol, and IOPump (type: tuple ) |
Create a loopback TLS connection with the given trust and keys. Like loopbackTLSConnection
,
but using in-memory certificates and keys rather than writing them to
disk.
Parameters | trustRoot | the trustRoot argument for the client connection's context. (type: sslverify.IOpenSSLTrustRoot ) |
privateKey | The private key. (type: str
(native string)) | |
serverCertificate | The certificate used by the server. | |
clientProtocols | The protocols the client is willing to negotiate using NPN/ALPN. | |
serverProtocols | The protocols the server is willing to negotiate using NPN/ALPN. | |
clientOptions | The type of OpenSSLCertificateOptions class to use for the
client. Defaults to OpenSSLCertificateOptions . | |
Returns | 3-tuple of server-protocol, client-protocol, and IOPump (type: tuple ) |
Create a temporary file to store some serializable-as-PEM objects in, and return its name.
Parameters | testCase | a test case to use for generating a temporary directory. (type: twisted.trial.unittest.TestCase ) |
dumpables | arguments are objects from pyOpenSSL with a dump method,
taking a pyOpenSSL file-type constant, such as
OpenSSL.crypto.FILETYPE_PEM or
OpenSSL.crypto.FILETYPE_ASN1 . (type: tuple
of object
with dump method taking int
returning bytes ) | |
Returns | the path to a file where all of the dumpables were dumped in PEM format. (type: str ) |
Create the TLS connection and negotiate a next protocol.
Parameters | serverProtocols | The protocols the server is willing to negotiate. |
clientProtocols | The protocols the client is willing to negotiate. | |
clientOptions | The type of OpenSSLCertificateOptions class to use for the
client. Defaults to OpenSSLCertificateOptions . | |
Returns | A tuple
of the negotiated protocol and the reason the connection was lost. |