| |
- __builtin__.tuple(__builtin__.object)
-
- DefaultVerifyPaths
- _ssl._SSLContext(__builtin__.object)
-
- SSLContext
- exceptions.ValueError(exceptions.StandardError)
-
- CertificateError
- socket._socketobject(__builtin__.object)
-
- SSLSocket
- socket.error(exceptions.IOError)
-
- SSLError
-
- SSLEOFError
- SSLSyscallError
- SSLWantReadError
- SSLWantWriteError
- SSLZeroReturnError
- _ASN1Object(_ASN1Object)
-
- Purpose
class DefaultVerifyPaths(__builtin__.tuple) |
|
DefaultVerifyPaths(cafile, capath, openssl_cafile_env, openssl_cafile, openssl_capath_env, openssl_capath) |
|
- Method resolution order:
- DefaultVerifyPaths
- __builtin__.tuple
- __builtin__.object
Methods defined here:
- __getnewargs__(self)
- Return self as a plain tuple. Used by copy and pickle.
- __getstate__(self)
- Exclude the OrderedDict from pickling
- __repr__(self)
- Return a nicely formatted representation string
- _asdict(self)
- Return a new OrderedDict which maps field names to their values
- _replace(_self, **kwds)
- Return a new DefaultVerifyPaths object replacing specified fields with new values
Class methods defined here:
- _make(cls, iterable, new=<built-in method __new__ of type object>, len=<built-in function len>) from __builtin__.type
- Make a new DefaultVerifyPaths object from a sequence or iterable
Static methods defined here:
- __new__(_cls, cafile, capath, openssl_cafile_env, openssl_cafile, openssl_capath_env, openssl_capath)
- Create new instance of DefaultVerifyPaths(cafile, capath, openssl_cafile_env, openssl_cafile, openssl_capath_env, openssl_capath)
Data descriptors defined here:
- __dict__
- Return a new OrderedDict which maps field names to their values
- cafile
- Alias for field number 0
- capath
- Alias for field number 1
- openssl_cafile
- Alias for field number 3
- openssl_cafile_env
- Alias for field number 2
- openssl_capath
- Alias for field number 5
- openssl_capath_env
- Alias for field number 4
Data and other attributes defined here:
- _fields = ('cafile', 'capath', 'openssl_cafile_env', 'openssl_cafile', 'openssl_capath_env', 'openssl_capath')
Methods inherited from __builtin__.tuple:
- __add__(...)
- x.__add__(y) <==> x+y
- __contains__(...)
- x.__contains__(y) <==> y in x
- __eq__(...)
- x.__eq__(y) <==> x==y
- __ge__(...)
- x.__ge__(y) <==> x>=y
- __getattribute__(...)
- x.__getattribute__('name') <==> x.name
- __getitem__(...)
- x.__getitem__(y) <==> x[y]
- __getslice__(...)
- x.__getslice__(i, j) <==> x[i:j]
Use of negative indices is not supported.
- __gt__(...)
- x.__gt__(y) <==> x>y
- __hash__(...)
- x.__hash__() <==> hash(x)
- __iter__(...)
- x.__iter__() <==> iter(x)
- __le__(...)
- x.__le__(y) <==> x<=y
- __len__(...)
- x.__len__() <==> len(x)
- __lt__(...)
- x.__lt__(y) <==> x<y
- __mul__(...)
- x.__mul__(n) <==> x*n
- __ne__(...)
- x.__ne__(y) <==> x!=y
- __rmul__(...)
- x.__rmul__(n) <==> n*x
- count(...)
- T.count(value) -> integer -- return number of occurrences of value
- index(...)
- T.index(value, [start, [stop]]) -> integer -- return first index of value.
Raises ValueError if the value is not present.
|
class Purpose(_ASN1Object) |
|
SSLContext purpose flags with X509v3 Extended Key Usage objects |
|
- Method resolution order:
- Purpose
- _ASN1Object
- _ASN1Object
- __builtin__.tuple
- __builtin__.object
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
Data and other attributes defined here:
- CLIENT_AUTH = _ASN1Object(nid=130, shortname='clientAuth', lon... Client Authentication', oid='1.3.6.1.5.5.7.3.2')
- SERVER_AUTH = _ASN1Object(nid=129, shortname='serverAuth', lon... Server Authentication', oid='1.3.6.1.5.5.7.3.1')
Class methods inherited from _ASN1Object:
- fromname(cls, name) from __builtin__.type
- Create _ASN1Object from short name, long name or OID
- fromnid(cls, nid) from __builtin__.type
- Create _ASN1Object from OpenSSL numeric ID
Static methods inherited from _ASN1Object:
- __new__(cls, oid)
Methods inherited from _ASN1Object:
- __getnewargs__(self)
- Return self as a plain tuple. Used by copy and pickle.
- __getstate__(self)
- Exclude the OrderedDict from pickling
- __repr__(self)
- Return a nicely formatted representation string
- _asdict(self)
- Return a new OrderedDict which maps field names to their values
- _replace(_self, **kwds)
- Return a new _ASN1Object object replacing specified fields with new values
Class methods inherited from _ASN1Object:
- _make(cls, iterable, new=<built-in method __new__ of type object>, len=<built-in function len>) from __builtin__.type
- Make a new _ASN1Object object from a sequence or iterable
Data descriptors inherited from _ASN1Object:
- longname
- Alias for field number 2
- nid
- Alias for field number 0
- oid
- Alias for field number 3
- shortname
- Alias for field number 1
Data and other attributes inherited from _ASN1Object:
- _fields = ('nid', 'shortname', 'longname', 'oid')
Methods inherited from __builtin__.tuple:
- __add__(...)
- x.__add__(y) <==> x+y
- __contains__(...)
- x.__contains__(y) <==> y in x
- __eq__(...)
- x.__eq__(y) <==> x==y
- __ge__(...)
- x.__ge__(y) <==> x>=y
- __getattribute__(...)
- x.__getattribute__('name') <==> x.name
- __getitem__(...)
- x.__getitem__(y) <==> x[y]
- __getslice__(...)
- x.__getslice__(i, j) <==> x[i:j]
Use of negative indices is not supported.
- __gt__(...)
- x.__gt__(y) <==> x>y
- __hash__(...)
- x.__hash__() <==> hash(x)
- __iter__(...)
- x.__iter__() <==> iter(x)
- __le__(...)
- x.__le__(y) <==> x<=y
- __len__(...)
- x.__len__() <==> len(x)
- __lt__(...)
- x.__lt__(y) <==> x<y
- __mul__(...)
- x.__mul__(n) <==> x*n
- __ne__(...)
- x.__ne__(y) <==> x!=y
- __rmul__(...)
- x.__rmul__(n) <==> n*x
- count(...)
- T.count(value) -> integer -- return number of occurrences of value
- index(...)
- T.index(value, [start, [stop]]) -> integer -- return first index of value.
Raises ValueError if the value is not present.
|
class SSLContext(_ssl._SSLContext) |
|
An SSLContext holds various SSL-related configuration options and
data, such as certificates and possibly a private key. |
|
- Method resolution order:
- SSLContext
- _ssl._SSLContext
- __builtin__.object
Methods defined here:
- __init__(self, protocol)
- load_default_certs(self, purpose=_ASN1Object(nid=129, shortname='serverAuth', lon... Server Authentication', oid='1.3.6.1.5.5.7.3.1'))
- set_alpn_protocols(self, alpn_protocols)
- set_npn_protocols(self, npn_protocols)
- wrap_socket(self, sock, server_side=False, do_handshake_on_connect=True, suppress_ragged_eofs=True, server_hostname=None)
Static methods defined here:
- __new__(cls, protocol, *args, **kwargs)
Data descriptors defined here:
- __weakref__
- list of weak references to the object (if defined)
- protocol
Methods inherited from _ssl._SSLContext:
- cert_store_stats(...)
- cert_store_stats() -> {'crl': int, 'x509_ca': int, 'x509': int}
Returns quantities of loaded X.509 certificates. X.509 certificates with a
CA extension and certificate revocation lists inside the context's cert
store.
NOTE: Certificates in a capath directory aren't loaded unless they have
been used at least once.
- get_ca_certs(...)
- get_ca_certs(binary_form=False) -> list of loaded certificate
Returns a list of dicts with information of loaded CA certs. If the
optional argument is True, returns a DER-encoded copy of the CA certificate.
NOTE: Certificates in a capath directory aren't loaded unless they have
been used at least once.
- load_cert_chain(...)
- load_dh_params(...)
- load_verify_locations(...)
- session_stats(...)
- set_ciphers(...)
- set_default_verify_paths(...)
- set_ecdh_curve(...)
- set_servername_callback(...)
- set_servername_callback(method)
This sets a callback that will be called when a server name is provided by
the SSL/TLS client in the SNI extension.
If the argument is None then the callback is disabled. The method is called
with the SSLSocket, the server name as a string, and the SSLContext object.
See RFC 6066 for details of the SNI extension.
Data descriptors inherited from _ssl._SSLContext:
- check_hostname
- options
- verify_flags
- verify_mode
|
class SSLSocket(socket._socketobject) |
|
This class implements a subtype of socket.socket that wraps
the underlying OS socket in an SSL context when necessary, and
provides read and write methods over that channel. |
|
- Method resolution order:
- SSLSocket
- socket._socketobject
- __builtin__.object
Methods defined here:
- __init__(self, sock=None, keyfile=None, certfile=None, server_side=False, cert_reqs=0, ssl_version=2, ca_certs=None, do_handshake_on_connect=True, family=2, type=1, proto=0, fileno=None, suppress_ragged_eofs=True, npn_protocols=None, ciphers=None, server_hostname=None, _context=None)
- accept(self)
- Accepts a new connection from a remote client, and returns
a tuple containing that new connection wrapped with a server-side
SSL channel, and the address of the remote client.
- cipher(self)
- close(self)
- compression(self)
- connect(self, addr)
- Connects to remote ADDR, and then wraps the connection in
an SSL channel.
- connect_ex(self, addr)
- Connects to remote ADDR, and then wraps the connection in
an SSL channel.
- do_handshake(self, block=False)
- Perform a TLS/SSL handshake.
- dup(self)
- get_channel_binding(self, cb_type='tls-unique')
- Get channel binding data for current connection. Raise ValueError
if the requested `cb_type` is not supported. Return bytes of the data
or None if the data is not available (e.g. before the handshake).
- getpeercert(self, binary_form=False)
- Returns a formatted version of the data in the
certificate provided by the other end of the SSL channel.
Return None if no certificate was provided, {} if a
certificate was provided, but not validated.
- makefile(self, mode='r', bufsize=-1)
- Make and return a file-like object that
works with the SSL connection. Just use the code
from the socket module.
- pending(self)
- read(self, len=0, buffer=None)
- Read up to LEN bytes and return them.
Return zero-length string on EOF.
- recv(self, buflen=1024, flags=0)
- recv_into(self, buffer, nbytes=None, flags=0)
- recvfrom(self, buflen=1024, flags=0)
- recvfrom_into(self, buffer, nbytes=None, flags=0)
- selected_alpn_protocol(self)
- selected_npn_protocol(self)
- send(self, data, flags=0)
- sendall(self, data, flags=0)
- sendto(self, data, flags_or_addr, addr=None)
- shutdown(self, how)
- unwrap(self)
- version(self)
- Return a string identifying the protocol version used by the
current SSL channel, or None if there is no established channel.
- write(self, data)
- Write DATA to the underlying SSL channel. Returns
number of bytes of DATA actually transmitted.
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- context
Methods inherited from socket._socketobject:
- bind(...)
- bind(address)
Bind the socket to a local address. For IP sockets, the address is a
pair (host, port); the host must refer to the local host. For raw packet
sockets the address is a tuple (ifname, proto [,pkttype [,hatype]])
- fileno(...)
- fileno() -> integer
Return the integer file descriptor of the socket.
- getpeername(...)
- getpeername() -> address info
Return the address of the remote endpoint. For IP sockets, the address
info is a pair (hostaddr, port).
- getsockname(...)
- getsockname() -> address info
Return the address of the local endpoint. For IP sockets, the address
info is a pair (hostaddr, port).
- getsockopt(...)
- getsockopt(level, option[, buffersize]) -> value
Get a socket option. See the Unix manual for level and option.
If a nonzero buffersize argument is given, the return value is a
string of that length; otherwise it is an integer.
- gettimeout(...)
- gettimeout() -> timeout
Returns the timeout in seconds (float) associated with socket
operations. A timeout of None indicates that timeouts on socket
operations are disabled.
- listen(...)
- listen(backlog)
Enable a server to accept connections. The backlog argument must be at
least 0 (if it is lower, it is set to 0); it specifies the number of
unaccepted connections that the system will allow before refusing new
connections.
- setblocking(...)
- setblocking(flag)
Set the socket to blocking (flag is true) or non-blocking (false).
setblocking(True) is equivalent to settimeout(None);
setblocking(False) is equivalent to settimeout(0.0).
- setsockopt(...)
- setsockopt(level, option, value)
Set a socket option. See the Unix manual for level and option.
The value argument can either be an integer or a string.
- settimeout(...)
- settimeout(timeout)
Set a timeout on socket operations. 'timeout' can be a float,
giving in seconds, or None. Setting a timeout of None disables
the timeout feature and is equivalent to setblocking(1).
Setting a timeout of zero is the same as setblocking(0).
Data descriptors inherited from socket._socketobject:
- __weakref__
- list of weak references to the object (if defined)
- family
- the socket family
- proto
- the socket protocol
- type
- the socket type
|
|