Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'suppose': 0.05; 'subject:version': 0.07; 'corresponds': 0.09; 'subject:python': 0.10; '25,': 0.12; 'library': 0.13; 'cc:addr:python-list': 0.15; 'this:': 0.15; 'adam': 0.16; 'openssl': 0.16; 'subject:linked': 0.16; 'wrote:': 0.16; 'wed,': 0.17; 'thanks,': 0.18; 'jan': 0.19; 'cc:no real name:2**0': 0.21; 'header:In-Reply-To:1': 0.22; 'cheers': 0.23; 'debian': 0.23; 'long.': 0.23; 'cc:2**0': 0.25; 'load': 0.26; 'import': 0.27; 'looks': 0.27; 'message- id:@mail.gmail.com': 0.28; 'print': 0.29; 'installed': 0.29; 'cc:addr:python.org': 0.29; 'ctypes': 0.30; 'received:209.85.210.46': 0.30; 'received:mail- pz0-f46.google.com': 0.30; 'subject:?': 0.30; 'version': 0.31; 'received:google.com': 0.37; 'could': 0.37; 'received:209.85': 0.38; 'received:209': 0.39; 'subject:: ': 0.39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=3DWACsnGcH1kZ2mDezfT1Hjbq/UIjpGqqX0efUyIJYg=; b=utCFsl3BcIGhqNUXPrdYtOHYs9kNULu5cHFO99a0+APDzmRUNrAoIFXvw0MMaQtZRO 3Msxhxq8foTnNZghWpIZ7GGomSv95E9tZlmwlB+f9zwYgHhWxrGsXex+nVNBaar8SJR3 T6hH6oKk1M+S+AoPV4bPqi63GxZeePqQ0ET4g= MIME-Version: 1.0 In-Reply-To: References: From: Adam Mercer Date: Wed, 25 Jan 2012 15:40:06 -0600 Subject: Re: Determining version of OpenSSL linked against python? To: Anssi Saari Content-Type: text/plain; charset=ISO-8859-1 Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 20 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1327527649 news.xs4all.nl 6851 [2001:888:2000:d::a6]:49434 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:19437 On Wed, Jan 25, 2012 at 15:21, Anssi Saari wrote: > I suppose you could use ctypes to load the library and call SSLeay() > which returns the OpenSSL version number as a C long. > > Like this: > > from ctypes import * > libssl = cdll.LoadLibrary("libssl.so") > openssl_version = libssl.SSLeay() > print "%.9X" % openssl_version > > This gives me 0009080FF which corresponds to 0.9.8o release which is > what I have installed in Debian Squeeze. Thanks, that looks useful. Cheers Adam