0

I'm trying to implement the answer found at Python Paste SSL server with TLSv1.2 and Forward Secrecy.

How do I use context.set_tmp_ecdh()? That method is not defined on either my Linux or Windows machines. It is in the pyOpenSSL docs, and various examples I've seen. I'm using Python 2.6.6 (or 2.7) and pyOpenSSL v 0.13 (specifically CentOS package pyOpenSSL-0.13.1-2.el6.x86_64.rpm). Is there a specific version or additional dependency, etc. that I'm missing?

Community
  • 1
  • 1
BuvinJ
  • 10,221
  • 5
  • 83
  • 96
  • Which version of OpenSSL you are using? To determine check `ssl.OPENSSL_VERSION`. – Steffen Ullrich Dec 02 '15 at 15:53
  • I'm now trying to implement the functionality "manually" (only updating my own code). I'm referencing https://groups.google.com/forum/#!topic/autobahnws/FacdoiUeY9s and https://github.com/pyca/pyopenssl/blob/master/src/OpenSSL/SSL.py – BuvinJ Dec 02 '15 at 16:09
  • Currently, I getting the error: ImportError: No module named cryptography.hazmat.bindings.openssl.binding – BuvinJ Dec 02 '15 at 16:10
  • The comment section is neither the place to add new questions nor to add updates to an existing question. If your question was answered (which it is in my opinion) please accept the answer. If you have additional questions then create a new question. – Steffen Ullrich Dec 02 '15 at 16:13
  • I was simply responding to your question. People go back and forth in the comment section constantly. – BuvinJ Dec 02 '15 at 16:33

1 Answers1

1

Support for ecdh was added in pyOpenSSL 0.15, so you can't use it with your installed version of pyOpenSSL.

You'll have to install a newer version.

mata
  • 67,110
  • 10
  • 163
  • 162
  • I'll look into that. I need to do this on CentOS 6, with python 2.6.6. I also need to do this on Windows with Python 2.7. So, I'm not yet sure about the details of that and any incompatibilities. – BuvinJ Dec 02 '15 at 16:36
  • This worked, but on my Linux machine the install wasn't straight forward. Refer to http://stackoverflow.com/questions/7340784/easy-install-pyopenssl-error/34048924#34048924. – BuvinJ Dec 02 '15 at 17:43
  • I got this to work in Windows too, but I had to upgrade from Python 2.7.5 to 2.7.9 and then install pyOpenSSL via "pip". I strongly suggest this method vs trying to install the new version of pyOpenSSL from source (as there is no longer an msi installer). – BuvinJ Dec 03 '15 at 16:09