hypercorn icon indicating copy to clipboard operation
hypercorn copied to clipboard

Rename ssl to tls

Open pquentin opened this issue 1 year ago • 2 comments

The ssl name clashes with the ssl module name and I intend to reuse this variable to carry information about the ASGI TLS extension.

pquentin avatar Dec 05 '23 19:12 pquentin

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.

pgjones avatar Dec 27 '23 18:12 pgjones

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?

pquentin avatar Jan 01 '24 13:01 pquentin

I'm not sure Hypercorn should always extract the TLS information - is this a costly operation?

pgjones avatar May 25 '24 20:05 pgjones

Yes, it is costly (I can measure it if you would like) and should be behind an option.

pquentin avatar May 26 '24 03:05 pquentin

Makes sense, I'd be happy with the ssl bool and the tls dictionary if the latter is enabled.

pgjones avatar May 27 '24 09:05 pgjones