LEFT | RIGHT |
1 # Wrapper module for _ssl, providing some additional facilities | 1 # Wrapper module for _ssl, providing some additional facilities |
2 # implemented in Python. Written by Bill Janssen. | 2 # implemented in Python. Written by Bill Janssen. |
3 | 3 |
4 """This module provides some more Pythonic support for SSL. | 4 """This module provides some more Pythonic support for SSL. |
5 | 5 |
6 Object types: | 6 Object types: |
7 | 7 |
8 SSLSocket -- subtype of socket.socket which does SSL over the socket | 8 SSLSocket -- subtype of socket.socket which does SSL over the socket |
9 | 9 |
10 Exceptions: | 10 Exceptions: |
(...skipping 1069 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1080 context = _create_stdlib_context(ssl_version, | 1080 context = _create_stdlib_context(ssl_version, |
1081 cert_reqs=cert_reqs, | 1081 cert_reqs=cert_reqs, |
1082 cafile=ca_certs) | 1082 cafile=ca_certs) |
1083 with create_connection(addr) as sock: | 1083 with create_connection(addr) as sock: |
1084 with context.wrap_socket(sock) as sslsock: | 1084 with context.wrap_socket(sock) as sslsock: |
1085 dercert = sslsock.getpeercert(True) | 1085 dercert = sslsock.getpeercert(True) |
1086 return DER_cert_to_PEM_cert(dercert) | 1086 return DER_cert_to_PEM_cert(dercert) |
1087 | 1087 |
1088 def get_protocol_name(protocol_code): | 1088 def get_protocol_name(protocol_code): |
1089 return _PROTOCOL_NAMES.get(protocol_code, '<unknown>') | 1089 return _PROTOCOL_NAMES.get(protocol_code, '<unknown>') |
LEFT | RIGHT |