-
-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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
Give access to openssl version number #52568
Comments
This patch gives access to the OpenSSL version the _ssl module is linked against, through three attributes: one gives the raw integer, another the decoded 5-tuple of ints, the last one the version string as returned by OpenSSL. |
(note: tested with OpenSSL 0.9.8k and 1.0.0) |
Can you please add documentation as well? |
New patch with doc. |
I was about to open a request for this. |
Committed, with Benjamin's permission, in r79812 (trunk) and r79813 (py3k). |
>>> import ssl
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/ssl.py", line 62, in <module>
from _ssl import OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_INFO, OPENSSL_VERSION
ImportError: cannot import name OPENSSL_VERSION_NUMBER Just in case it's my fault, here's what I've done before importing ssl module:
|
> >>> import ssl
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> File "/usr/local/lib/python2.7/ssl.py", line 62, in <module>
> from _ssl import OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_INFO, OPENSSL_VERSION
> ImportError: cannot import name OPENSSL_VERSION_NUMBER This looks rather unlikely. |
The ./configure -> make -> make install process went fine, or at least, I think so, as it completed without reporting errors or exiting. So I'm gonna ask: when I modify *.c files, do I have to do something else other than "./configure; make; make install" in order to see the changes applied? Anyway, here's what you asked: root@ubuntu:/home/giampaolo/svn/python-2.7# python
Python 2.7a4+ (trunk:79814, Apr 5 2010, 23:53:01)
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import _ssl
>>> _ssl
<module '_ssl' from '/usr/local/lib/python2.7/lib-dynload/_ssl.so'>
>>> _ssl.__file__
'/usr/local/lib/python2.7/lib-dynload/_ssl.so'
>>> |
No. If you run the Python binary from the SVN checkout directory (rather $ pwd
/home/antoine/cpython/newssl
$ ./python -c "import _ssl; print _ssl.__file__"
/home/antoine/cpython/newssl/build/lib.linux-x86_64-2.7/_ssl.so If _ssl is coming from "/usr/local/lib/...", it means that something |
Oh, sorry, I had overlooked the "make install" bit. And check the output of "make" after you have touched Modules/_ssl.c |
You were right: make output had an error involving ssl I didn't notice. My bad. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: