Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(19)

Delta Between Two Patch Sets: Lib/ssl.py

Issue 20421: expose SSL socket protocol version
Left Patch Set: Created 5 years, 5 months ago
Right Patch Set: Created 5 years, 5 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « Doc/library/ssl.rst ('k') | Lib/test/test_ssl.py » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(Both sides are equal)
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 945 matching lines...) Expand 10 before | Expand all | Expand 10 after
956 context = _create_stdlib_context(ssl_version, 956 context = _create_stdlib_context(ssl_version,
957 cert_reqs=cert_reqs, 957 cert_reqs=cert_reqs,
958 cafile=ca_certs) 958 cafile=ca_certs)
959 with create_connection(addr) as sock: 959 with create_connection(addr) as sock:
960 with context.wrap_socket(sock) as sslsock: 960 with context.wrap_socket(sock) as sslsock:
961 dercert = sslsock.getpeercert(True) 961 dercert = sslsock.getpeercert(True)
962 return DER_cert_to_PEM_cert(dercert) 962 return DER_cert_to_PEM_cert(dercert)
963 963
964 def get_protocol_name(protocol_code): 964 def get_protocol_name(protocol_code):
965 return _PROTOCOL_NAMES.get(protocol_code, '<unknown>') 965 return _PROTOCOL_NAMES.get(protocol_code, '<unknown>')
LEFTRIGHT

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+