Support Linux bundle OpenSSL
This commit is contained in:
parent
2a7d7acce0
commit
d3fce8ca36
2 changed files with 10 additions and 7 deletions
|
@ -11,11 +11,13 @@ from util import helper
|
|||
|
||||
class CryptConnectionManager:
|
||||
def __init__(self):
|
||||
# OpenSSL params
|
||||
if sys.platform.startswith("win"):
|
||||
self.openssl_bin = "tools\\openssl\\openssl.exe"
|
||||
elif config.dist_type.startswith("bundle_linux"):
|
||||
self.openssl_bin = "../runtime/bin/openssl"
|
||||
else:
|
||||
self.openssl_bin = "openssl"
|
||||
|
||||
self.openssl_env = {
|
||||
"OPENSSL_CONF": "src/lib/openssl/openssl.cnf",
|
||||
"RANDFILE": config.data_dir + "/openssl-rand.tmp"
|
||||
|
|
|
@ -11,18 +11,19 @@ find_library_original = ctypes.util.find_library
|
|||
def getOpensslPath():
|
||||
if sys.platform.startswith("win"):
|
||||
lib_paths = [
|
||||
os.path.join(os.getcwd(), "tools/openssl/libeay32.dll"),
|
||||
os.path.join(os.getcwd(), "tools/openssl/libeay32.dll"), # ZeroBundle Windows
|
||||
os.path.join(os.path.dirname(sys.executable), "DLLs/libcrypto-1_1-x64.dll"),
|
||||
os.path.join(os.path.dirname(sys.executable), "DLLs/libcrypto-1_1.dll")
|
||||
]
|
||||
elif sys.platform == "cygwin":
|
||||
lib_paths = ["/bin/cygcrypto-1.0.0.dll"]
|
||||
elif os.path.isfile("../lib/libcrypto.so"): # ZeroBundle OSX
|
||||
lib_paths = ["../lib/libcrypto.so"]
|
||||
elif os.path.isfile("/opt/lib/libcrypto.so.1.0.0"): # For optware and entware
|
||||
lib_paths = ["/opt/lib/libcrypto.so.1.0.0"]
|
||||
else:
|
||||
lib_paths = ["/usr/local/ssl/lib/libcrypto.so"]
|
||||
lib_paths = [
|
||||
"../runtime/lib/libcrypto.so.1.1", # ZeroBundle Linux
|
||||
"../lib/libcrypto.so", # ZeroBundle OSX
|
||||
"/opt/lib/libcrypto.so.1.0.0", # For optware and entware
|
||||
"/usr/local/ssl/lib/libcrypto.so"
|
||||
]
|
||||
|
||||
for lib_path in lib_paths:
|
||||
if os.path.isfile(lib_path):
|
||||
|
|
Loading…
Reference in a new issue