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

Delta Between Two Patch Sets: Lib/ssl.py

Issue 22417: PEP 476: verify HTTPS certificates by default
Left Patch Set: Created 4 years, 7 months ago
Right Patch Set: Created 4 years, 7 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 | « Lib/http/client.py ('k') | Lib/test/test_httplib.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
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
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>')
LEFTRIGHT

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