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

TypeError with Python 3.x when raising exception for unknown server names #20

Open
geofft opened this issue May 25, 2017 · 1 comment
Open

Comments

@geofft
Copy link

geofft commented May 25, 2017

I touched a .pem file for one hostname and used twist web --port le:/home/geofft/twisted/certs:tcp:443 to run a server. I then accessed the server over a different hostname, and got a few of these tracebacks:

2017-05-24T22:09:48-0400 [stderr#error] From cffi callback <function SNIMap.selectContext at 0x7f90c9857ea0>:
2017-05-24T22:09:48-0400 [stderr#error] Traceback (most recent call last):
2017-05-24T22:09:48-0400 [stderr#error]   File "/home/geofft/twisted/lib/python3.4/site-packages/txacme/challenges/_tls.py", line 28, in __getitem__ 
2017-05-24T22:09:48-0400 [stderr#error]     return self.overlay[key]
2017-05-24T22:09:48-0400 [stderr#error] KeyError: b'dev.ldpreload.com'
2017-05-24T22:09:48-0400 [stderr#error] During handling of the above exception, another exception occurred:
2017-05-24T22:09:48-0400 [stderr#error] Traceback (most recent call last):
2017-05-24T22:09:48-0400 [stderr#error]   File "/home/geofft/twisted/lib/python3.4/site-packages/OpenSSL/SSL.py", line 1132, in wrapper
2017-05-24T22:09:48-0400 [stderr#error]     callback(Connection._reverse_mapping[ssl])
2017-05-24T22:09:48-0400 [stderr#error]   File "/home/geofft/twisted/lib/python3.4/site-packages/txsni/snimap.py", line 133, in selectContext
2017-05-24T22:09:48-0400 [stderr#error]     newContext = self.mapping[connection.get_servername()].getContext()
2017-05-24T22:09:48-0400 [stderr#error]   File "/home/geofft/twisted/lib/python3.4/site-packages/txacme/challenges/_tls.py", line 30, in __getitem__
2017-05-24T22:09:48-0400 [stderr#error]     return self.underlay[key]
2017-05-24T22:09:48-0400 [stderr#error]   File "/home/geofft/twisted/lib/python3.4/site-packages/txsni/snimap.py", line 181, in __getitem__
2017-05-24T22:09:48-0400 [stderr#error]     raise KeyError("no pem file for " + hostname)
2017-05-24T22:09:48-0400 [stderr#error] TypeError: Can't convert 'bytes' object to str implicitly
@glyph
Copy link
Owner

glyph commented May 26, 2017

Thanks for the bug report. This should definitely be fixed.

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 a pull request may close this issue.

2 participants