Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/HelloZeroNet/ZeroNet
Browse files Browse the repository at this point in the history
  • Loading branch information
shortcutme committed Mar 23, 2019
2 parents 06be430 + 116347e commit abb566e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Site/SiteAnnouncer.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,13 @@ def getAddressParts(self, tracker):
if "://" not in tracker or not re.match("^[A-Za-z0-9:/\\.#-]+$", tracker):
return None
protocol, address = tracker.split("://", 1)
ip, port = address.rsplit(":", 1)
try:
ip, port = address.rsplit(":", 1)
except ValueError as err:
ip = address
port = 80
if protocol.startswith("https"):
port = 443
back = {}
back["protocol"] = protocol
back["address"] = address
Expand Down
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 abb566e

Please sign in to comment.