Rev667, Fix cygwin openssl loading for real

This commit is contained in:
HelloZeroNet 2015-12-21 11:29:38 +01:00
parent 394a8b16b7
commit 35b0019be2
4 changed files with 22 additions and 26 deletions

View File

@ -8,7 +8,7 @@ class Config(object):
def __init__(self, argv):
self.version = "0.3.4"
self.rev = 665
self.rev = 667
self.argv = argv
self.action = None
self.createParser()

View File

@ -195,14 +195,13 @@ ssl = None
def openLibrary():
global ssl
try:
dll_paths = [
"src/lib/opensslVerify/libeay32.dll",
"/usr/local/ssl/lib/libcrypto.so",
"/bin/cygcrypto-1.0.0.dll"
]
for dll_path in dll_paths :
if os.path.isfile(dll_path):
ssl = _OpenSSL(dll_path)
if sys.platform.startswith("win"):
dll_path = "src/lib/opensslVerify/libeay32.dll"
elif sys.platform == "cygwin":
dll_path = "/bin/cygcrypto-1.0.0.dll"
else:
dll_path = "/usr/local/ssl/lib/libcrypto.so"
ssl = _OpenSSL(dll_path)
assert ssl
except Exception, err:
ssl = _OpenSSL(ctypes.util.find_library('ssl') or ctypes.util.find_library('crypto') or ctypes.util.find_library('libcrypto') or 'libeay32')

View File

@ -431,15 +431,13 @@ class _OpenSSL:
def openLibrary():
global OpenSSL
try:
dll_paths = [
"src/lib/opensslVerify/libeay32.dll",
"/usr/local/ssl/lib/libcrypto.so",
"/bin/cygcrypto-1.0.0.dll"
]
for dll_path in dll_paths :
print dll_path
if os.path.isfile(dll_path):
ssl = _OpenSSL(dll_path)
if sys.platform.startswith("win"):
dll_path = "src/lib/opensslVerify/libeay32.dll"
elif sys.platform == "cygwin":
dll_path = "/bin/cygcrypto-1.0.0.dll"
else:
dll_path = "/usr/local/ssl/lib/libcrypto.so"
ssl = _OpenSSL(dll_path)
assert ssl
except Exception, err:
ssl = _OpenSSL(ctypes.util.find_library('ssl') or ctypes.util.find_library('crypto') or ctypes.util.find_library('libcrypto') or 'libeay32')

View File

@ -11,14 +11,13 @@ def openLibrary():
import ctypes
import ctypes.util
try:
dll_paths = [
"src/lib/opensslVerify/libeay32.dll",
"/usr/local/ssl/lib/libcrypto.so",
"/bin/cygcrypto-1.0.0.dll"
]
for dll_path in dll_paths:
if os.path.isfile(dll_path):
ssl = ctypes.CDLL(dll_path, ctypes.RTLD_GLOBAL)
if sys.platform.startswith("win"):
dll_path = "src/lib/opensslVerify/libeay32.dll"
elif sys.platform == "cygwin":
dll_path = "/bin/cygcrypto-1.0.0.dll"
else:
dll_path = "/usr/local/ssl/lib/libcrypto.so"
ssl = ctypes.CDLL(dll_path, ctypes.RTLD_GLOBAL)
assert ssl
except:
dll_path = ctypes.util.find_library('ssl') or ctypes.util.find_library('crypto') or ctypes.util.find_library('libcrypto')