hypercorn
hypercorn copied to clipboard
Rename ssl to tls
The ssl name clashes with the ssl module name and I intend to reuse this variable to carry information about the ASGI TLS extension.
Given the extension is called tls, wouldn't the other way around make more sense? I'm also unsure as "ssl" is used in asyncio so seems the correct name.
Thanks for the review.
My initial idea was to avoid adding two keyword arguments, ssl and tls. The two next commits in that series are https://github.com/urllib3/hypercorn/commit/ed84446d8770f2219711b5a79dafe11a66ef79ee (turning tls in an optional dictionary) and https://github.com/urllib3/hypercorn/commit/3dd81376b98b337dfb64ee00a50791066149821e (actually implementing the extension - this one is still incomplete).
Do I understand correctly that you'd prefer having both an ssl boolean and a tls optional dictionary, with tls set only when ssl is true and the user has asked for the TLS extension?
I'm not sure Hypercorn should always extract the TLS information - is this a costly operation?
Yes, it is costly (I can measure it if you would like) and should be behind an option.
Makes sense, I'd be happy with the ssl bool and the tls dictionary if the latter is enabled.