summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorliris <liris.pp@gmail.com>2014-08-26 10:33:38 +0900
committerliris <liris.pp@gmail.com>2014-08-26 10:33:38 +0900
commit748f56bbe015140e5b329731b76aecc9e4fde94f (patch)
treee3f72aa333c2aec8782abb3c69ab233044e750a9
parentaa66645afc6c8bc72e84e9de63d1752cf9ebad14 (diff)
downloadwebsocket-client-ssl.tar.gz
- add document how to disable ssl cert verification.ssl
- refs #101
-rw-r--r--README.rst19
-rw-r--r--websocket/_core.py2
2 files changed, 21 insertions, 0 deletions
diff --git a/README.rst b/README.rst
index 8f73075..9491f0b 100644
--- a/README.rst
+++ b/README.rst
@@ -118,6 +118,25 @@ JavaScript websocket-like API example::
ws.run_forever()
+FAQ
+============
+
+How to disable ssl cert verification?
+----------------------------------------
+
+Please set sslopt to {"cert_reqs": ssl.CERT_NONE}.
+
+ ws = websocket.WebSocketApp("https://echo.websocket.org")
+ ws.run_forever(sslopt={"cert_reqs": ssl.CERT_NONE})
+
+ ws = websocket.create_connection("https://echo.websocket.org",
+ sslopt={"cert_reqs": ssl.CERT_NONE})
+
+ ws = websocket.WebSocket(sslopt={"cert_reqs": ssl.CERT_NONE})
+ ws.connect("https://echo.websocket.org")
+
+
+
wsdump.py
============
diff --git a/websocket/_core.py b/websocket/_core.py
index 2776853..fba7e70 100644
--- a/websocket/_core.py
+++ b/websocket/_core.py
@@ -206,6 +206,8 @@ def create_connection(url, timeout=None, **options):
"http_proxy_host" - http proxy host name.
"http_proxy_port" - http proxy port. If not set, set to 80.
"enable_multithread" -> enable lock for multithread.
+ "sockopt" -> socket options
+ "sslopt" -> ssl option
"""
sockopt = options.get("sockopt", [])
sslopt = options.get("sslopt", {})