Rev667, Fix cygwin openssl loading for real
This commit is contained in:
parent
394a8b16b7
commit
35b0019be2
4 changed files with 22 additions and 26 deletions
|
@ -8,7 +8,7 @@ class Config(object):
|
||||||
|
|
||||||
def __init__(self, argv):
|
def __init__(self, argv):
|
||||||
self.version = "0.3.4"
|
self.version = "0.3.4"
|
||||||
self.rev = 665
|
self.rev = 667
|
||||||
self.argv = argv
|
self.argv = argv
|
||||||
self.action = None
|
self.action = None
|
||||||
self.createParser()
|
self.createParser()
|
||||||
|
|
|
@ -195,14 +195,13 @@ ssl = None
|
||||||
def openLibrary():
|
def openLibrary():
|
||||||
global ssl
|
global ssl
|
||||||
try:
|
try:
|
||||||
dll_paths = [
|
if sys.platform.startswith("win"):
|
||||||
"src/lib/opensslVerify/libeay32.dll",
|
dll_path = "src/lib/opensslVerify/libeay32.dll"
|
||||||
"/usr/local/ssl/lib/libcrypto.so",
|
elif sys.platform == "cygwin":
|
||||||
"/bin/cygcrypto-1.0.0.dll"
|
dll_path = "/bin/cygcrypto-1.0.0.dll"
|
||||||
]
|
else:
|
||||||
for dll_path in dll_paths :
|
dll_path = "/usr/local/ssl/lib/libcrypto.so"
|
||||||
if os.path.isfile(dll_path):
|
ssl = _OpenSSL(dll_path)
|
||||||
ssl = _OpenSSL(dll_path)
|
|
||||||
assert ssl
|
assert ssl
|
||||||
except Exception, err:
|
except Exception, err:
|
||||||
ssl = _OpenSSL(ctypes.util.find_library('ssl') or ctypes.util.find_library('crypto') or ctypes.util.find_library('libcrypto') or 'libeay32')
|
ssl = _OpenSSL(ctypes.util.find_library('ssl') or ctypes.util.find_library('crypto') or ctypes.util.find_library('libcrypto') or 'libeay32')
|
||||||
|
|
|
@ -431,15 +431,13 @@ class _OpenSSL:
|
||||||
def openLibrary():
|
def openLibrary():
|
||||||
global OpenSSL
|
global OpenSSL
|
||||||
try:
|
try:
|
||||||
dll_paths = [
|
if sys.platform.startswith("win"):
|
||||||
"src/lib/opensslVerify/libeay32.dll",
|
dll_path = "src/lib/opensslVerify/libeay32.dll"
|
||||||
"/usr/local/ssl/lib/libcrypto.so",
|
elif sys.platform == "cygwin":
|
||||||
"/bin/cygcrypto-1.0.0.dll"
|
dll_path = "/bin/cygcrypto-1.0.0.dll"
|
||||||
]
|
else:
|
||||||
for dll_path in dll_paths :
|
dll_path = "/usr/local/ssl/lib/libcrypto.so"
|
||||||
print dll_path
|
ssl = _OpenSSL(dll_path)
|
||||||
if os.path.isfile(dll_path):
|
|
||||||
ssl = _OpenSSL(dll_path)
|
|
||||||
assert ssl
|
assert ssl
|
||||||
except Exception, err:
|
except Exception, err:
|
||||||
ssl = _OpenSSL(ctypes.util.find_library('ssl') or ctypes.util.find_library('crypto') or ctypes.util.find_library('libcrypto') or 'libeay32')
|
ssl = _OpenSSL(ctypes.util.find_library('ssl') or ctypes.util.find_library('crypto') or ctypes.util.find_library('libcrypto') or 'libeay32')
|
||||||
|
|
|
@ -11,14 +11,13 @@ def openLibrary():
|
||||||
import ctypes
|
import ctypes
|
||||||
import ctypes.util
|
import ctypes.util
|
||||||
try:
|
try:
|
||||||
dll_paths = [
|
if sys.platform.startswith("win"):
|
||||||
"src/lib/opensslVerify/libeay32.dll",
|
dll_path = "src/lib/opensslVerify/libeay32.dll"
|
||||||
"/usr/local/ssl/lib/libcrypto.so",
|
elif sys.platform == "cygwin":
|
||||||
"/bin/cygcrypto-1.0.0.dll"
|
dll_path = "/bin/cygcrypto-1.0.0.dll"
|
||||||
]
|
else:
|
||||||
for dll_path in dll_paths:
|
dll_path = "/usr/local/ssl/lib/libcrypto.so"
|
||||||
if os.path.isfile(dll_path):
|
ssl = ctypes.CDLL(dll_path, ctypes.RTLD_GLOBAL)
|
||||||
ssl = ctypes.CDLL(dll_path, ctypes.RTLD_GLOBAL)
|
|
||||||
assert ssl
|
assert ssl
|
||||||
except:
|
except:
|
||||||
dll_path = ctypes.util.find_library('ssl') or ctypes.util.find_library('crypto') or ctypes.util.find_library('libcrypto')
|
dll_path = ctypes.util.find_library('ssl') or ctypes.util.find_library('crypto') or ctypes.util.find_library('libcrypto')
|
||||||
|
|
Loading…
Reference in a new issue