MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / _encrypt_on

Function _encrypt_on

tools/python-3.11.9-amd64/Lib/nntplib.py:285–295  ·  view source on GitHub ↗

Wrap a socket in SSL/TLS. Arguments: - sock: Socket to wrap - context: SSL context to use for the encrypted connection Returns: - sock: New, encrypted socket.

(sock, context, hostname)

Source from the content-addressed store, hash-verified

283if _have_ssl:
284
285 def _encrypt_on(sock, context, hostname):
286 """Wrap a socket in SSL/TLS. Arguments:
287 - sock: Socket to wrap
288 - context: SSL context to use for the encrypted connection
289 Returns:
290 - sock: New, encrypted socket.
291 """
292 # Generate a default SSL context if none was passed.
293 if context is None:
294 context = ssl._create_stdlib_context()
295 return context.wrap_socket(sock, server_hostname=hostname)
296
297
298# The classes themselves

Callers 2

starttlsMethod · 0.85
_create_socketMethod · 0.85

Calls 1

wrap_socketMethod · 0.45

Tested by

no test coverage detected