Browse Source

use certifi directly instead of requests

3.3.3.1
SomberNight 6 years ago
parent
commit
78f5afff74
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 1
      contrib/requirements/requirements.txt
  2. 4
      electrum/interface.py
  3. 4
      electrum/paymentrequest.py
  4. 4
      electrum/util.py
  5. 4
      electrum/x509.py
  6. 4
      run_electrum

1
contrib/requirements/requirements.txt

@ -9,3 +9,4 @@ qdarkstyle<2.6
aiorpcx>=0.9,<0.11
aiohttp
aiohttp_socks
certifi

4
electrum/interface.py

@ -33,7 +33,7 @@ from collections import defaultdict
import aiorpcx
from aiorpcx import RPCSession, Notification
import requests
import certifi
from .util import PrintError, ignore_exceptions, log_exceptions, bfh, SilentTaskGroup
from . import util
@ -49,7 +49,7 @@ if TYPE_CHECKING:
from .network import Network
ca_path = requests.certs.where()
ca_path = certifi.where()
class NotificationSession(RPCSession):

4
electrum/paymentrequest.py

@ -28,7 +28,7 @@ import time
import traceback
import json
import requests
import certifi
import urllib.parse
import aiohttp
@ -49,7 +49,7 @@ from .network import Network
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() # FIXME do we need to depend on requests here?
ca_path = certifi.where()
ca_list = None
ca_keyID = None

4
electrum/util.py

@ -45,7 +45,7 @@ import ssl
import aiohttp
from aiohttp_socks import SocksConnector, SocksVer
from aiorpcx import TaskGroup
import requests
import certifi
from .i18n import _
@ -59,7 +59,7 @@ def inv_dict(d):
return {v: k for k, v in d.items()}
ca_path = requests.certs.where()
ca_path = certifi.where()
base_units = {'BTC':8, 'mBTC':5, 'bits':2, 'sat':0}

4
electrum/x509.py

@ -337,8 +337,8 @@ def load_certificates(ca_path):
if __name__ == "__main__":
import requests
import certifi
util.set_verbosity(True)
ca_path = requests.certs.where()
ca_path = certifi.where()
ca_list, ca_keyID = load_certificates(ca_path)

4
run_electrum

@ -44,7 +44,7 @@ def check_imports():
import dns
import pyaes
import ecdsa
import requests
import certifi
import qrcode
import google.protobuf
import jsonrpclib
@ -58,7 +58,7 @@ def check_imports():
from google.protobuf import descriptor_pb2
from jsonrpclib import SimpleJSONRPCServer
# make sure that certificates are here
assert os.path.exists(requests.utils.DEFAULT_CA_BUNDLE_PATH)
assert os.path.exists(certifi.where())
if not is_android:

Loading…
Cancel
Save