Skip to content

Commit

Permalink
[graphenewsrpc] don't explicitly search for a ca-cert on wss connections
Browse files Browse the repository at this point in the history
  • Loading branch information
xeroc committed Aug 8, 2016
1 parent 5c28535 commit 59ee8bb
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions grapheneapi/graphenewsrpc.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import sys
import threading
from websocket import create_connection
import websocket
import ssl
# from websocket._exceptions import WebSocketConnectionClosedException
import json
import time
Expand Down Expand Up @@ -64,11 +65,17 @@ def get_request_id(self):
return self._request_id

def wsconnect(self):
if self.url[:3] == "wss":
sslopt_ca_certs = {'cert_reqs': ssl.CERT_NONE}
self.ws = websocket.WebSocket(sslopt=sslopt_ca_certs)
else:
self.ws = websocket.WebSocket()

cnt = 0
while True:
cnt += 1
try:
self.ws = create_connection(self.url)
self.ws.connect(self.url)
break
except KeyboardInterrupt:
raise
Expand Down

0 comments on commit 59ee8bb

Please sign in to comment.