Skip to content
This repository has been archived by the owner on Jan 13, 2021. It is now read-only.

Commit

Permalink
Merge pull request #316 from vfaronov/fix-ssl-context-docs
Browse files Browse the repository at this point in the history
Fix the documentation on overriding the SSL context
  • Loading branch information
Lukasa committed Mar 5, 2017
2 parents 8a95ad6 + 12d0941 commit 6f464ae
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions docs/source/advanced.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,15 @@ SSL/TLS Certificate Verification
By default, all HTTP/2 connections are made over TLS, and ``hyper`` bundles
certificate authorities that it uses to verify the offered TLS certificates.

You can change how certificates are verified by passing your own
``ssl_context`` to the :class:`HTTPConnection <hyper.HTTPConnection>`.
For example, this will disable verification altogether::
You can change how certificates are verified by getting a new SSL context
from :func:`hyper.tls.init_context`, tweaking its options, and passing it
to the :class:`HTTPConnection <hyper.HTTPConnection>`. For example, this will
disable verification altogether::

import ssl
context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
context = hyper.tls.init_context()
context.check_hostname = False
context.verify_mode = ssl.CERT_NONE
conn = HTTPConnection('http2bin.org:443', ssl_context=context)

Streaming Uploads
Expand Down

0 comments on commit 6f464ae

Please sign in to comment.