diff --git a/tumblebit/__init__.py b/tumblebit/__init__.py index 83efd5f..2cd36f0 100644 --- a/tumblebit/__init__.py +++ b/tumblebit/__init__.py @@ -2,6 +2,7 @@ import ctypes.util import logging from platform import system +import config ########################################################################### ## CTypes -- Function Definitions @@ -24,12 +25,18 @@ ######################################################## # Change path to where libressl library is -# TODO: Add an option to specify the path in some sort of -# config file. -if(system() == "Darwin"): - path = "/usr/local/opt/libressl/lib/libssl.dylib" +try: + config.LIBRESSL_PATH +except NameError: + # doesn't print err, sets default. when the path is loaded if location + # does not exist will error. Consider warning here to make easy to + # find config + if(system() == "Darwin"): + path = "/usr/local/opt/libressl/lib/libssl.dylib" + else: + path = "/usr/local/lib/libssl.so" else: - path = "/usr/local/lib/libssl.so" + path = config.LIBRESSL_PATH _ssl = ctypes.cdll.LoadLibrary(path) _ssl.SSL_load_error_strings() diff --git a/tumblebit/config.py b/tumblebit/config.py new file mode 100644 index 0000000..4574384 --- /dev/null +++ b/tumblebit/config.py @@ -0,0 +1,3 @@ +LIBRESSL_PATH = "/usr/local/lib/libssl.so" + +