-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using multiple TLS certificates #35
Comments
Also as another workaround, it'd be nice to see wildcard certs mentioned in the README, where Edit: Example command for
This is in line with other cert recommendations such as using a 5 year cert, and using a 256-bit EC key which is nice and small. |
All of the TLS configuration happens in this class: Line 84 in efe41ec
Currently, the class is initialized with a single cert/key pair. It generates a single I think the general approach for adding SNI should be something like this
I would like keep the default behavior as close to the Twisted standard convention as possible. So I'm drawn towards keeping the default context as-is: GeminiCertficateOptions._context: OpenSSL.SSL.Context And then adding an additional cache for hostname-specific contexts: GeminiCertficateOptions._sni_context: Dict[str, OpenSSL.SSL.Context] Then, the lookup would turn into something like this def get_context(self, hostname)
return self._sni_context.get(hostname, self._context) Currently the "default" certificate is passed into the
I'm not married to this approach though, and I'm open to alternatives if they end up being more straightforward. |
Oh okay. Looks like there's a lot to learn here ha! I thought there would be something like |
Yea.. I still have a lot to learn about it too 😄
I think the reason is because you need to establish the OpenSSL socket in order to accept the initial TLS client hello handshake, before you even get the the part of the handshake where the SNI becomes available. So you need some kind of initial SSL context already in place to handle the connection. The python standard library |
Ah okay, that makes sense. Thanks for the explanation! |
I saw this on the README:
What work is required to achieve this for Jetforce? I wouldn't mind trying to help with this.
The text was updated successfully, but these errors were encountered: