Skip to content

ssl.get_server_certificate(addr, ca_certs=...) verifies the chain but never the identity #161503

Open

Description

@brettcs

Bug report

Doc/library/ssl.rst:411-413 says of ca_certs that "the call will attempt to validate the server certificate against that set of root certificates, and will fail if the validation attempt fails". It validates the chain and never checks that the certificate is for the host contacted.

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

Linked PRs

Activity

  1. added
    type-bugAn unexpected behavior, bug, or error
    on Nov 6, 2026
  2. added 2 commits that reference this issue on Nov 6, 2026
  3. added
    stdlibStandard Library Python modules in the Lib/ directory
    3.11only security fixes
    3.12only security fixes
    3.13only security fixes
    3.14bugs and security fixes
    3.15bugs and security fixes
    3.16new features, bugs and security fixes
    and removed
    type-bugAn unexpected behavior, bug, or error
    on Nov 6, 2026
  4. added 2 commits that reference this issue on Nov 6, 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

    3.11only security fixes3.12only security fixes3.13only security fixes3.14bugs and security fixes3.15bugs and security fixes3.16new features, bugs and security fixesstdlibStandard Library Python modules in the Lib/ directorytopic-SSLtype-securityA security issue

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions