Skip to content

Commit

Permalink
Merge pull request HelloZeroNet#1916 from rllola/ld-library-path-openssl
Browse files Browse the repository at this point in the history
Ld library path openssl
  • Loading branch information
HelloZeroNet authored Mar 6, 2019
2 parents 44c467f + 32ddaed commit 1ad44ac
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/util/SslPatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ def getLibraryPath():
except Exception, err:
logging.debug("OpenSSL lib not found in: %s (%s)" % (lib_dir, err))

if "LD_LIBRARY_PATH" in os.environ:
lib_dir_paths = os.environ["LD_LIBRARY_PATH"].split(":")
for path in lib_dir_paths:
try:
return [lib for lib in os.listdir(path) if "libcrypto.so.1.0" in lib][0]
except Exception, err:
logging.debug("OpenSSL lib not found in: %s (%s)" % (path, err))

return (
ctypes.util.find_library('ssl.so.1.0') or ctypes.util.find_library('ssl') or
ctypes.util.find_library('crypto') or ctypes.util.find_library('libcrypto') or 'libeay32'
Expand Down

0 comments on commit 1ad44ac

Please sign in to comment.