check that pyopenssl > 0.12 is installed before using fonctions available after this version

This commit is contained in:
Yann Leboulanger 2012-01-04 11:38:09 +01:00
parent 8e72a23918
commit 359d3c3069
2 changed files with 6 additions and 2 deletions

View File

@ -4,6 +4,10 @@ log = logging.getLogger('gajim.c.check_X509')
try: try:
import OpenSSL.SSL import OpenSSL.SSL
import OpenSSL.crypto import OpenSSL.crypto
ver = OpenSSL.__version__
ver_l = [int(i) for i in ver.split('.')]
if ver_l < [0, 12]:
raise ImportError
from pyasn1.type import univ, constraint, char, namedtype, tag from pyasn1.type import univ, constraint, char, namedtype, tag
from pyasn1.codec.der.decoder import decode from pyasn1.codec.der.decoder import decode
from common.helpers import prep, InvalidFormat from common.helpers import prep, InvalidFormat

View File

@ -49,8 +49,8 @@ class FeaturesWindow:
self.features = { self.features = {
_('SSL certificate validation'): (self.pyopenssl_available, _('SSL certificate validation'): (self.pyopenssl_available,
_('A library used to validate server certificates to ensure a secure connection.'), _('A library used to validate server certificates to ensure a secure connection.'),
_('Requires python-pyopenssl.'), _('Requires python-pyopenssl > 0.12 and pyasn1.'),
_('Requires python-pyopenssl.')), _('Requires python-pyopenssl > 0.12 and pyasn1.')),
_('Bonjour / Zeroconf'): (self.zeroconf_available, _('Bonjour / Zeroconf'): (self.zeroconf_available,
_('Serverless chatting with autodetected clients in a local network.'), _('Serverless chatting with autodetected clients in a local network.'),
_('Requires python-avahi.'), _('Requires python-avahi.'),