Skip to content

PEP748 tlslib - configuration#4958

Open
Julien00859 wants to merge 5 commits intopython:mainfrom
Julien00859:Julien00859/tlslib-config
Open

PEP748 tlslib - configuration#4958
Julien00859 wants to merge 5 commits intopython:mainfrom
Julien00859:Julien00859/tlslib-config

Conversation

@Julien00859
Copy link
Copy Markdown

First time contributor 🎉

A few suggestions to make the configuration a bit more explicit. I decided to leave most of the attributes undocumented as they are pretty explicit to me, and to instead only document the few attributes that are different from the client and the server.

PEP 748: ConfigurationError is only for unsupported features

Discussed at trailofbits/tlslib.py#72 (comment)

ConfigurationError was intended for when specific implementations don't support certain behavior (e.g. adding a certificate by identifier). I think ValueError should be fine, probably raised when validating the configuration. ~Joop

PEP 748: certificate_chain is mandatory server-side

Discussed at https://discuss.python.org/t/pre-pep-discussion-revival-of-pep-543-a-unified-tls-api-for-python/51263/75

This makes sense to me. We can allow empty server certificates in the insecure module. ~Joop

PEP 748: disambiguate config trust_store=None

Discussed at https://discuss.python.org/t/pre-pep-discussion-revival-of-pep-543-a-unified-tls-api-for-python/51263/78

I agree, this is better. ~Joop

Ease reading the diff of the next commits.
Client-side `trust_store=None` means `TrustStore.system()` but
server-side it means "skip client authentication". One could think it
means "skip server authentication" when used client-side, so let's not
support `None` at all client-side and instead default to
`TrustStore.system()`.
TLS 1.3 and secure TLS 1.2 both require a certificate and private key
server-side. Making the parameter mandatory makes it explicit that one
is required. It still is optional client-side.
@Julien00859 Julien00859 requested a review from ncoghlan as a code owner May 6, 2026 22:03
@python-cla-bot
Copy link
Copy Markdown

python-cla-bot Bot commented May 6, 2026

All commit authors signed the Contributor License Agreement.

CLA signed

@read-the-docs-community
Copy link
Copy Markdown

Documentation build overview

📚 pep-previews | 🛠️ Build #32573746 | 📁 Comparing ea0b73f against latest (c093d5f)

  🔍 Preview build  

709 files changed · ± 709 modified

± Modified

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant