Unable to connect to electrum server
Error: HTTPConnectionPool(host='electrum.eff.ro', port=50002): Max retries exceeded with url: / (Caused by NewConnectionError(': Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'))
Connection is done in python:
electrum wallet jsonRPC authentication
import requests
import json
def main():
url = "http://electrum.eff.ro:50002"
payload = json.dumps(
{
"id": 0,
"method": "server.version",
"params": ["1.9.5", "0.6"]
}
)
headers = {'content-type': "application/json", 'cache-control': "no-cache"}
try:
response = requests.request("POST", url, data=payload, headers=headers, auth=(rpc_user, rpc_password))
return json.loads(response.text)
except requests.exceptions.RequestException as e:
print(e)
except:
print('No response from Wallet, check Bitcoin is running on this machine')
rpc_user = 'foo'
rpc_password = 'bar'
if __name__ == "__main__":
answer = main()
Such an error is constantly displayed.
UPD:
Server: url = "http://fortress.qtornado.com:443"
error:
('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
if connect HTTPS:
url = "https://fortress.qtornado.com:443"
error:
HTTPSConnectionPool(host='fortress.qtornado.com', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1051)')))
How to connect using ssl certificate?