File tree 1 file changed +7
-4
lines changed
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -72,12 +72,15 @@ SSL/TLS Certificate Verification
72
72
By default, all HTTP/2 connections are made over TLS, and ``hyper `` bundles
73
73
certificate authorities that it uses to verify the offered TLS certificates.
74
74
75
- You can change how certificates are verified by passing your own
76
- ``ssl_context `` to the :class: `HTTPConnection <hyper.HTTPConnection> `.
77
- For example, this will disable verification altogether::
75
+ You can change how certificates are verified by getting a new SSL context
76
+ from :func: `hyper.tls.init_context `, tweaking its options, and passing it
77
+ to the :class: `HTTPConnection <hyper.HTTPConnection> `. For example, this will
78
+ disable verification altogether::
78
79
79
80
import ssl
80
- context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
81
+ context = hyper.tls.init_context()
82
+ context.check_hostname = False
83
+ context.verify_mode = ssl.CERT_NONE
81
84
conn = HTTPConnection('http2bin.org:443', ssl_context=context)
82
85
83
86
Streaming Uploads
You can’t perform that action at this time.
0 commit comments