Skip to content

ssl docs: custom client socket example never connects #161763

Open

Description

@notatallshaw

The custom-context client example wraps a new socket and immediately prints ssock.version(). It never calls connect(), so version() returns None and no TLS connection is made.

The SSLContext.wrap_socket() description also says that "context construction" is deferred for an unconnected client socket. The context already exists; CPython creates the underlying SSL object when SSLSocket.connect() is called. The example should connect before printing the negotiated version, and the description should name the deferred operation.

Linked PRs

Activity

  1. notatallshaw commented on Nov 10, 2026

    @notatallshaw
    ContributorAuthor

    This came up reviewing an error that can happen in truststore: sethmlarson/truststore#271

  2. added a commit that references this issue on Nov 10, 2026
  3. added 3 commits that reference this issue on Nov 12, 2026
  4. added a commit that references this issue on Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dirtopic-SSL

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions