python / python/cpython

Improve usage of `_setSSLError` in `_ssl.c`

Open
#138,634 0 comments 1 reaction 1 assignee View on GitHub

@picnixz is already working on this.

Since Sep 8, 2025.

extension-modules sprint topic-SSL type-refactor
Dominant language
Python
Stars
77.2k
Forks
35.9k
PR merge metrics
PR metrics pending

Description

Proposal:

Based on https://github.com/python/cpython/pull/137198#discussion_r2282082902, we should refactor _setSSLError as the errcode argument is redundant. In addition, we should:

  • Change _ssl__SSLContext_set_ciphers_impl to use _setSSLError as in _ssl__SSLContext_set_ciphersuites_impl.
  • If possible, ease the use of _setSSLError.
  • If possible, ease how we indicate that a functionality is not implemented and document which exception is being actually raised (this needs to be synchronized with https://github.com/python/cpython/issues/138633).
Has this already been discussed elsewhere?

I have already discussed this feature proposal.

Links to previous discussion of this feature:

[!NOTE]
I will take care of this myself.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.