PyDocs

Nav

Networking and Interprocess Communication

create_default_context

ssl

function · Added in 3.4 (source) not WASI
  • create_default_context(purpose=Purpose.SERVER_AUTH, *, cafile=None, capath=None, cadata=None)
Create a SSLContext object with default settings.

NOTE: The protocol and settings may change anytime without prior
      deprecation. The values represent a fair balance between maximum
      compatibility and security.
Changed in 3.4.4, 3.6, 3.8, 3.10, 3.13
  • 3.4.4: RC4 was dropped from the default cipher string.
  • 3.6: ChaCha20/Poly1305 was added to the default cipher string. 3DES was dropped from the default cipher string.
  • 3.8: Support for key logging to SSLKEYLOGFILE was added.
  • 3.10: The context now uses PROTOCOL_TLS_CLIENT or PROTOCOL_TLS_SERVER protocol instead of generic PROTOCOL_TLS.
  • 3.13: The context now uses VERIFY_X509_PARTIAL_CHAIN and VERIFY_X509_STRICT in its default verify flags.
1 Example
>>> context = ssl.create_default_context()
from the Python docs
See Also
No see-alsos for ssl/create_default_context
0 Notes
No notes for create_default_context