MCPcopy Index your code
hub / github.com/python/cpython / check_ssl_verifiy

Function check_ssl_verifiy

Lib/test/test_smtpnet.py:15–24  ·  view source on GitHub ↗
(host, port)

Source from the content-addressed store, hash-verified

13SMTP_TEST_SERVER = os.getenv('CPYTHON_TEST_SMTP_SERVER', 'smtp.gmail.com')
14
15def check_ssl_verifiy(host, port):
16 context = ssl.create_default_context()
17 with socket.create_connection((host, port)) as sock:
18 try:
19 sock = context.wrap_socket(sock, server_hostname=host)
20 except Exception:
21 return False
22 else:
23 sock.close()
24 return True
25
26
27class SmtpTest(unittest.TestCase):

Calls 3

wrap_socketMethod · 0.80
create_connectionMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…