summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorJean-Paul Calderone <exarkun@twistedmatrix.com>2015-04-13 21:43:33 -0400
committerJean-Paul Calderone <exarkun@twistedmatrix.com>2015-04-13 21:43:33 -0400
commitf0e74563a5c4309e6c27e46bf29ca333a04d5210 (patch)
tree02bdce954b5c2a00b65d831c47d4974ff36b5782 /doc
parent9be8519b76c27ec26159dfc8e7747367fe609ff1 (diff)
parent5c3b748846ad1f9597d51b24d04ac394980c2480 (diff)
downloadpyopenssl-git-f0e74563a5c4309e6c27e46bf29ca333a04d5210.tar.gz
merge master
Diffstat (limited to 'doc')
-rw-r--r--doc/api/ssl.rst36
1 files changed, 36 insertions, 0 deletions
diff --git a/doc/api/ssl.rst b/doc/api/ssl.rst
index e6a0775..2929305 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