pydtls/dtls/__init__.py
Ray Brown 77a50c7382 Implement and turn on the osnet demux
This change introduces a demux that uses the kernel's network stack for UDP
datagram-to-socket assignment based on packet source address (as opposed to the
forwarding strategy of the routing demux). The osnet demux is used by default
on non-Windows platforms. When possible, use of the osnet demux is preferred
over the routing demux, since it can be expected to perform better.

The unit test suite has been extended to run all tests first with the demux
selected by default for the current platform, and then with the routing demux,
if the latter differs from the former. Tests were already being run twice, first
with IPv4 and then with IPv6, and thus we now run each test four times on
Linux, twice on Windows.

All unit tests pass with both demux types.
2012-11-27 21:33:09 -08:00

21 lines
822 B
Python

# PyDTLS: datagram TLS for Python. Written by Ray Brown.
"""PyDTLS package
This package exports OpenSSL's DTLS support to Python. Calling its patch
function will add the constant PROTOCOL_DTLSv1 to the Python standard library's
ssl module. Subsequently passing a datagram socket to that module's
wrap_socket function (or instantiating its SSLSocket class with a datagram
socket) will activate this module's DTLS implementation for the returned
SSLSocket instance.
Instead of or in addition to invoking the patch functionality, the
SSLConnection class can be used directly for secure communication over datagram
sockets.
wrap_socket's parameters and their semantics have been maintained.
"""
from patch import do_patch
from sslconnection import SSLConnection
from demux import force_routing_demux, reset_default_demux