Skip to content

Commit d3fce8c

Browse files
committed
Support Linux bundle OpenSSL
1 parent 2a7d7ac commit d3fce8c

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

src/Crypt/CryptConnection.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@
1111

1212
class CryptConnectionManager:
1313
def __init__(self):
14-
# OpenSSL params
1514
if sys.platform.startswith("win"):
1615
self.openssl_bin = "tools\\openssl\\openssl.exe"
16+
elif config.dist_type.startswith("bundle_linux"):
17+
self.openssl_bin = "../runtime/bin/openssl"
1718
else:
1819
self.openssl_bin = "openssl"
20+
1921
self.openssl_env = {
2022
"OPENSSL_CONF": "src/lib/openssl/openssl.cnf",
2123
"RANDFILE": config.data_dir + "/openssl-rand.tmp"

src/util/OpensslFindPatch.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,19 @@
1111
def getOpensslPath():
1212
if sys.platform.startswith("win"):
1313
lib_paths = [
14-
os.path.join(os.getcwd(), "tools/openssl/libeay32.dll"),
14+
os.path.join(os.getcwd(), "tools/openssl/libeay32.dll"), # ZeroBundle Windows
1515
os.path.join(os.path.dirname(sys.executable), "DLLs/libcrypto-1_1-x64.dll"),
1616
os.path.join(os.path.dirname(sys.executable), "DLLs/libcrypto-1_1.dll")
1717
]
1818
elif sys.platform == "cygwin":
1919
lib_paths = ["/bin/cygcrypto-1.0.0.dll"]
20-
elif os.path.isfile("../lib/libcrypto.so"): # ZeroBundle OSX
21-
lib_paths = ["../lib/libcrypto.so"]
22-
elif os.path.isfile("/opt/lib/libcrypto.so.1.0.0"): # For optware and entware
23-
lib_paths = ["/opt/lib/libcrypto.so.1.0.0"]
2420
else:
25-
lib_paths = ["/usr/local/ssl/lib/libcrypto.so"]
21+
lib_paths = [
22+
"../runtime/lib/libcrypto.so.1.1", # ZeroBundle Linux
23+
"../lib/libcrypto.so", # ZeroBundle OSX
24+
"/opt/lib/libcrypto.so.1.0.0", # For optware and entware
25+
"/usr/local/ssl/lib/libcrypto.so"
26+
]
2627

2728
for lib_path in lib_paths:
2829
if os.path.isfile(lib_path):

0 commit comments

Comments
 (0)