Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #19432
| From | Nick Dokos <nicholas.dokos@hp.com> |
|---|---|
| Subject | Re: Determining version of OpenSSL linked against python? |
| References | <CA+mfgz1PMHc=REJxCcXVxSNxCJxVLAPiAJO5CN-LiycFSvdsNQ@mail.gmail.com> <CA+mfgz0JRxjgWQg7SAw80+gKyOFdU+sYo0w2NnCs84-4TD7-mw@mail.gmail.com> <jfpn8h$ihh$1@dough.gmane.org> <CA+mfgz0OyPXDP+Onbs2gfn5A6qB3CzBQTJMNbd32k0gQwR=Eeg@mail.gmail.com> |
| Organization | HPCS |
| Date | 2012-01-25 15:56 -0500 |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.5093.1327524989.27778.python-list@python.org> (permalink) |
Adam Mercer <ramercer@gmail.com> wrote: > On Wed, Jan 25, 2012 at 14:04, Terry Reedy <tjreedy@udel.edu> wrote: > > > If you are not willing to tell Debian Squeeze users to install 2.7, or that > > they cannot run your program, ask the bug reporter to tell you what version > > of OpenSSL the system comes with and code it into your program. > > I would like to only support python-2.7 as that would make a few other > things easier but the powers that be think otherwise, I unfortunately > need to target python-2.6. > > > Or possibly, depending on what you do with the version info and what the > > differences are between versions, replace 'if version ...' constructs with > > 'try ... except...' constructs. > > My code already has a try... except block that tries the > ssl.OPENSSL_VERSION approach first but I wanted to have a fallback > method that works with python-2.6. Looks like I may need to hardcode > certain things. > One other possibility is to parse the output of ssh -V: ,---- | $ ssh -V | OpenSSH_5.8p1 Debian-1ubuntu3, OpenSSL 0.9.8o 01 Jun 2010 | $ python | Python 2.7.1+ (r271:86832, Apr 11 2011, 18:13:53) | [GCC 4.5.2] on linux2 | Type "help", "copyright", "credits" or "license" for more information. | >>> import ssl | >>> ssl.OPENSSL_VERSION | 'OpenSSL 0.9.8o 01 Jun 2010' | >>> `---- This assumes that ssh and python would use the same version of openssl: not guaranteed, but seems like a "reasonable" assumption to me. Nick
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: Determining version of OpenSSL linked against python? Nick Dokos <nicholas.dokos@hp.com> - 2012-01-25 15:56 -0500
csiph-web