diff options
author | Cory Benfield <lukasaoz@gmail.com> | 2014-06-07 15:42:56 +0100 |
---|---|---|
committer | Cory Benfield <lukasaoz@gmail.com> | 2015-04-13 16:11:48 -0400 |
commit | 12eae89a977508c957d2f388240ae7b90a2630e9 (patch) | |
tree | 3581b707078ca267ee489d0e547434e8debe892f /doc/api | |
parent | 4ca37f747d9dcc21d6f85655895e1e997937a670 (diff) | |
download | pyopenssl-12eae89a977508c957d2f388240ae7b90a2630e9.tar.gz |
Add ALPN support.
Diffstat (limited to 'doc/api')
-rw-r--r-- | doc/api/ssl.rst | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/doc/api/ssl.rst b/doc/api/ssl.rst index e6a0775..2d85126 100644 --- a/doc/api/ssl.rst +++ b/doc/api/ssl.rst @@ -498,6 +498,26 @@ Context objects have the following methods: .. versionadded:: 0.15 +.. py:method:: Context.set_alpn_protos(protos) + + Specify the protocols that the client is prepared to speak after the TLS + connection has been negotiated, using Application Layer Protocol + Negotiation. + + *protos* should be a list of protocols that the client is offering, each + as a bytestring. For example, ``[b'http/1.1', b'spdy/2']``. + + +.. py:method:: Context.set_alpn_select_callback(callback) + + Specify a callback function that will be called on the server when a client + offers protocols using Application Layer Protocol Negotiation. + + *callback* should be the callback function. It will be invoked with two + arguments: the :py:class:`Connection`, and a list of offered protocols as + bytestrings, e.g. ``[b'http/1.1', b'spdy/2']``. It should return one of + these bytestrings, the chosen protocol. + .. _openssl-session: @@ -849,6 +869,22 @@ Connection objects have the following methods: .. versionadded:: 0.15 +.. py:method:: Connection.set_alpn_protos(protos) + + Specify the protocols that the client is prepared to speak after the TLS + connection has been negotiated, using Application Layer Protocol + Negotiation. + + *protos* should be a list of protocols that the client is offering, each + as a bytestring. For example, ``[b'http/1.1', b'spdy/2']``. + + +.. py:method:: Connection.get_alpn_proto_negotiated() + + Get the protocol that was negotiated by Application Layer Protocol + Negotiation. Returns a bytestring of the protocol name. If no protocol has + been negotiated yet, returns an empty string. + .. Rubric:: Footnotes |