connecting
This commit is contained in:
parent
d3d5fdf687
commit
b1515e46c5
6
electrum
6
electrum
|
@ -74,9 +74,9 @@ def check_imports():
|
|||
from google.protobuf import descriptor_pb2
|
||||
from jsonrpclib import SimpleJSONRPCServer
|
||||
# make sure that certificates are here
|
||||
if not is_macOS:
|
||||
# cannot check if path exists inside zip on macOS
|
||||
assert os.path.exists(requests.utils.DEFAULT_CA_BUNDLE_PATH)
|
||||
if is_bundle and is_macOS:
|
||||
requests.utils.DEFAULT_CA_BUNDLE_PATH = os.path.join(os.path.dirname(__file__), 'cacert.pem')
|
||||
assert os.path.exists(requests.utils.DEFAULT_CA_BUNDLE_PATH)
|
||||
|
||||
|
||||
if not is_android:
|
||||
|
|
|
@ -31,11 +31,9 @@ import threading
|
|||
import time
|
||||
import traceback
|
||||
|
||||
import requests
|
||||
from .util import print_error, get_cert_path
|
||||
|
||||
from .util import print_error
|
||||
|
||||
ca_path = requests.certs.where()
|
||||
ca_path = get_cert_path()
|
||||
|
||||
from . import util
|
||||
from . import x509
|
||||
|
|
|
@ -39,7 +39,7 @@ except ImportError:
|
|||
|
||||
from . import bitcoin
|
||||
from . import util
|
||||
from .util import print_error, bh2u, bfh
|
||||
from .util import print_error, bh2u, bfh, get_cert_path
|
||||
from . import transaction
|
||||
from . import x509
|
||||
from . import rsakey
|
||||
|
@ -49,7 +49,7 @@ from .bitcoin import TYPE_ADDRESS
|
|||
REQUEST_HEADERS = {'Accept': 'application/bitcoin-paymentrequest', 'User-Agent': 'Electrum'}
|
||||
ACK_HEADERS = {'Content-Type':'application/bitcoin-payment','Accept':'application/bitcoin-paymentack','User-Agent':'Electrum'}
|
||||
|
||||
ca_path = requests.certs.where()
|
||||
ca_path = get_cert_path()
|
||||
ca_list = None
|
||||
ca_keyID = None
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@ import traceback
|
|||
import urllib
|
||||
import threading
|
||||
import hmac
|
||||
import requests
|
||||
|
||||
from .i18n import _
|
||||
|
||||
|
@ -40,6 +41,9 @@ def inv_dict(d):
|
|||
return {v: k for k, v in d.items()}
|
||||
|
||||
|
||||
is_bundle = getattr(sys, 'frozen', False)
|
||||
is_macOS = sys.platform == 'darwin'
|
||||
|
||||
base_units = {'ZCL':8, 'mZCL':5, 'uZCL':2}
|
||||
fee_levels = [_('Within 25 blocks'), _('Within 10 blocks'), _('Within 5 blocks'), _('Within 2 blocks'), _('In the next block')]
|
||||
|
||||
|
@ -687,3 +691,8 @@ class QueuePipe:
|
|||
self.send(request)
|
||||
|
||||
|
||||
def get_cert_path():
|
||||
if is_bundle and is_macOS:
|
||||
# set in ./electrum
|
||||
return requests.utils.DEFAULT_CA_BUNDLE_PATH
|
||||
return requests.certs.where()
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
from . import util
|
||||
from .util import profiler, bh2u
|
||||
from .util import profiler, bh2u, get_cert_path
|
||||
import ecdsa
|
||||
import hashlib
|
||||
|
||||
|
@ -334,8 +334,8 @@ def load_certificates(ca_path):
|
|||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import requests
|
||||
|
||||
util.set_verbosity(True)
|
||||
ca_path = requests.certs.where()
|
||||
ca_path = get_cert_path()
|
||||
|
||||
ca_list, ca_keyID = load_certificates(ca_path)
|
||||
|
|
|
@ -13,16 +13,16 @@ import shutil
|
|||
|
||||
from lib.version import ELECTRUM_VERSION as version
|
||||
|
||||
CERT_PATH = requests.certs.where()
|
||||
|
||||
name = "Electrum"
|
||||
mainscript = 'electrum-mac'
|
||||
mainscript = 'electrum'
|
||||
|
||||
plist = Plist.fromFile('Info.plist')
|
||||
plist.update(dict(CFBundleIconFile='electrum.icns'))
|
||||
|
||||
|
||||
CERT_PATH = requests.certs.where()
|
||||
|
||||
os.environ["REQUESTS_CA_BUNDLE"] = "cacert.pem"
|
||||
shutil.copy(mainscript, mainscript + '.py')
|
||||
mainscript += '.py'
|
||||
extra_options = dict(
|
||||
|
|
Loading…
Reference in New Issue