Skip to content

Instantly share code, notes, and snippets.

@kporangehat
Last active March 10, 2016 21:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kporangehat/7c4dbf9809819d765c9a to your computer and use it in GitHub Desktop.
Save kporangehat/7c4dbf9809819d765c9a to your computer and use it in GitHub Desktop.
This is an error I received in the `mitmproxy` event log while running a python script to connect to our server over `HTTPS`.

Summary

This is an error I received in the mitmproxy event log while running a python script to connect to our server over HTTPS. The script uses httplib2 (we need to support old Python versions :/).

Issue details
  • Python 2.7.10 (using pyenv)
  • OS X 10.11
  • ssl module compiled against OpenSSL v0.9.8zg
  • HTTPS connection fails with the following error from the event log in mitmproxy
Error
127.0.0.1:56425: ProtocolException("Error in HTTP connection: HttpSyntaxException('Bad HTTP request line: \\x80F\\x01\\x03\\x01\\x00-\\x00\\x00\\x00\\x10\\x00\\x009\\x00\\x008\\x00\\x005\\x00\\x00\\x16\\x00\\x00\\x13\\x00\\x00',)",)
Workaround
  • If I swap in an ssl module compiled with OpenSSL 1.0.2d, the request succeeds without issue.

Not sure if this is user error, an issue with that version of OpenSSL, or a bug in mitmproxy. I haven't opened an Issue for it because I'm not entirely convinced where the issue lies yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment