Skip to content
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

support different certificates for every (hostname, protocol) tuple or just letsencrypt #25

Open
dholth opened this issue Mar 22, 2019 · 1 comment

Comments

@dholth
Copy link

dholth commented Mar 22, 2019

The acme letsencrypt protocol requires a special certificate if acme-tls/1 is used. acme-tls/1 is negotiated through alpn. I think the necessary hook would be here: https://github.com/glyph/txsni/blob/master/txsni/snimap.py#L95

Wrap cb(context, protocols) in _ContextProxy.set_alpn_select_callback. If the original callback function in twisted/internet/_sslverify.py returns b'acme/1', set the context as in selectContext(self, connection), but look for the certificate in self.acme_mapping[connection.get_servername()] (it might be in a different directory acme/servername.pem)

@dholth
Copy link
Author

dholth commented Mar 22, 2019

It looks like it is possible to set_alpn_protos inside the set_alpn_select_callback. This means you don't have to append tls-acme/1 to acceptable protocols and complicate the proxy object. You can just say you're using it after the client asks for it.

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

No branches or pull requests

1 participant