Skip to content

Commit

Permalink
Proper fix for SSL for websocket
Browse files Browse the repository at this point in the history
  • Loading branch information
xeroc committed Mar 23, 2018
1 parent 2b57393 commit 59b3a62
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions grapheneapi/graphenewsrpc.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import websocket
# import ssl
import ssl
import json
import time
import logging
Expand Down Expand Up @@ -78,7 +78,8 @@ def wsconnect(self):
self.url = next(self.urls)
log.debug("Trying to connect to node %s" % self.url)
if self.url[:3] == "wss":
sslopt_ca_certs = {} # {'cert_reqs': ssl.CERT_NONE}
ssl_defaults = ssl.get_default_verify_paths()
sslopt_ca_certs = {'ca_certs': ssl_defaults.cafile}
self.ws = websocket.WebSocket(sslopt=sslopt_ca_certs)
else:
self.ws = websocket.WebSocket()
Expand Down

0 comments on commit 59b3a62

Please sign in to comment.