Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #36471

Re: ANN: PyDTLS

Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <ray@liquibits.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'python.': 0.02; 'url:pypi': 0.03; 'handler': 0.04; 'case.': 0.05; 'guido': 0.05; 'say,': 0.05; 'socket': 0.05; 'pypi': 0.07; 'referring': 0.07; 'subject:ANN': 0.07; 'python': 0.09; 'callable': 0.09; 'descriptor': 0.09; 'outlined': 0.09; 'pep': 0.09; 'rfc': 0.09; 'rossum': 0.09; 'timeout': 0.09; 'url:donations': 0.09; 'url:github': 0.09; 'cc:addr:python-list': 0.10; 'sfxlen:2': 0.10; 'url:psf': 0.10; 'assume': 0.11; 'apache': 0.13; 'packages.': 0.15; 'passing': 0.15; '0.1.0': 0.16; 'af_inet,': 0.16; 'asyncore': 0.16; 'considers': 0.16; 'expires,': 0.16; 'iteration': 0.16; 'iteration.': 0.16; 'module).': 0.16; 'polling': 0.16; 'sock': 0.16; 'socket.': 0.16; 'tcp': 0.16; 'timeout,': 0.16; 'udp,': 0.16; 'wrote:': 0.17; 'certainly': 0.17; 'implementing': 0.17; 'library,': 0.17; 'ssl': 0.17; 'jan': 0.18; 'module': 0.19; 'community.': 0.20; 'equivalent': 0.20; 'parameters': 0.20; 'sort': 0.21; 'bit': 0.21; 'import': 0.21; 'not,': 0.21; 'facility': 0.22; 'occurs': 0.22; 'cc:2**0': 0.23; 'monday,': 0.23; 'nearly': 0.23; "python's": 0.23; 'sets': 0.23; 'somewhere': 0.24; 'pass': 0.25; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'am,': 0.27; 'environment.': 0.27; '(as': 0.27; 'message-id:@mail.gmail.com': 0.27; 'interface': 0.27; 'forces': 0.29; 'peer': 0.29; 'protocols': 0.29; 'ray': 0.29; 'socket,': 0.29; 'url:mailman': 0.29; 'van': 0.29; "i'm": 0.29; 'becomes': 0.30; 'hosted': 0.30; 'function': 0.30; 'code': 0.31; 'server.': 0.32; 'url:python': 0.32; 'url:listinfo': 0.32; 'received:74.125.82': 0.33; 'skip:s 30': 0.33; 'received:google.com': 0.34; 'project': 0.34; 'loss': 0.34; 'minimum': 0.34; 'server': 0.35; 'whatever': 0.35; 'there': 0.35; 'next': 0.35; 'received:74.125': 0.36; 'url:org': 0.36; 'announce': 0.36; 'client': 0.36; 'thank': 0.36; 'possible': 0.37; 'does': 0.37; 'two': 0.37; 'being': 0.37; 'subject:: ': 0.38; 'easier': 0.38; 'some': 0.38; 'things': 0.38; 'sure': 0.38; 'instead': 0.39; 'to:addr:python.org': 0.39; 'takes': 0.39; 'header:Received:5': 0.40; 'url:mail': 0.40; 'easy': 0.60; 'most': 0.61; 'you.': 0.61; 'side': 0.61; 'interest': 0.62; 'time,': 0.62; 'situation': 0.62; 'our': 0.65; 'license': 0.65; 'reached': 0.65; 'url:0': 0.67; 'sounds': 0.71; 'manner': 0.74; '2013': 0.84; 'feedback,': 0.84; 'lost,': 0.84; 'omission': 0.84; 'tie': 0.84; 'url:python-announce-list': 0.84; 'expires': 0.91; 'gladly': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=liquibits.com; s=google; h=mime-version:sender:x-originating-ip:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=gpfi9kXzybjFS4pZNIjEvdXq/AqVNnLI0Qq8iOD2Uwk=; b=WbiDgEsioCaCskMkeHpQ8AdX53KYfYrdAAVx8wYa9TLkNdfGof+gm/Qg0iLToAtxPg 68xfNsd3WiDt/a5eTEPzaK/fbyXWtTGMtjiPHnwtYYH8kfxzdioL+tV7qKZL/sMcursF UUyZG/wNxSEx0BU4aceuYbd2OwXcfNeeDk4zQ=
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:x-originating-ip:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :x-gm-message-state; bh=gpfi9kXzybjFS4pZNIjEvdXq/AqVNnLI0Qq8iOD2Uwk=; b=TdoqA2uMWGEKjXmDdovlP2OGKr9akcWbNeieMRm0Tq/9MffbiEaU+vHHp5z4XN1xC3 qM1Xgp49EI+hSSDZoeSIZMVKIiU/pSlP1iKJkymnx6qbybp4h6xybazqnbtizRu0WVaf +V5K+wPNJ+jLPg9dAScaMLKnmQzFSgv5yPhzdDc/BVahgHWeXyBSpgQJn1mNwyA8BWda AFBUsLryCCqfAOX7yY86QkgDIiuYwW7dk0M7gDK3nvADPBLHfcfuP+bk96N0XfTRgkCm 8ymzDbeYkVaeF9Cngs3f82uBW/XdsW0JEZHow8o7QO6SqvbwaKSRNSKbXy50Y/FSD7+e grSg==
MIME-Version 1.0
Sender ray@liquibits.com
X-Originating-IP [76.104.190.126]
In-Reply-To <CAP7+vJ+Wop13D3qZ2Un6p1F-Oecjahc7dE2SgndtmcoOc1m5mg@mail.gmail.com>
References <CAAvW-fYH_n732uH4xEdQo_9RjHJM3Z4EiY-Bnu=_Drq37RgB8A@mail.gmail.com> <CAP7+vJ+Wop13D3qZ2Un6p1F-Oecjahc7dE2SgndtmcoOc1m5mg@mail.gmail.com>
Date Tue, 8 Jan 2013 20:39:00 -0800
X-Google-Sender-Auth M8W-21AYLjDRxPKZKP9mia5RqOo
Subject Re: ANN: PyDTLS
From rbit <py@liquibits.com>
To Guido van Rossum <guido@python.org>
Content-Type text/plain; charset=ISO-8859-1
X-Gm-Message-State ALoCoQm6yE4CI0B0E94ukRT3iI+xcfVdJPw79X0CVLPZ7b1Ahqj6FE5chd+A0hhR2WFgsISsWZOr
Cc "python-list@python.org" <python-list@python.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.305.1357706348.2939.python-list@python.org> (permalink)
Lines 87
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1357706348 news.xs4all.nl 6897 [2001:888:2000:d::a6]:41655
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:36471

Show key headers only | View raw


Thank you. I will gladly port to Python 3 if there is interest from
the community.

Regarding PEP 3156: asynchronous use of unreliable network protocols
makes for an interesting use case. In particular, it forces
applications to deal with packet loss under some circumstances. One
such situation occurs during DTLS's handshaking phase: if no response
is received from the peer after some period of time, we must assume
that our most recent datagram has been lost, and so we need to
retransmit. The event loop interface as outlined in the PEP makes this
a bit difficult (as did the asyncore module). One possible way to make
things easier would be by adding two parameters to add_reader: a
callable to retrieve the current timeout, and a callable that is
invoked if that timeout expires before the descriptor becomes
readable. Each loop iteration would then collect all given timeouts,
and pass the minimum of that set to whatever polling facility it
invokes. If that timeout expires, the corresponding timeout handler
would be invoked prior to the next loop iteration.

The PEP also considers only stream transports when referring to
"transport." Datagram transports do not, for example, have the
property that calling t.write(b'abc'); t.write(b'def') is equivalent
to calling t.write(b'abcdef'). I'm not sure what sort of impact this
omission of datagram transports has for an implementation. Though I
would certainly like to see datagram transports be treated as
first-class citizens, despite not being nearly used as often as stream
transports. I would hope that an implementer of, say, RTP over UDP,
can tie into the same event loop as someone implementing a
single-process, single-threaded Web server.

Implementing DTLS as a tulip transport sounds interesting. Is the
tulip package available somewhere so that I can try it out?

Ray

On Tue, Jan 8, 2013 at 6:53 AM, Guido van Rossum <guido@python.org> wrote:
> This sounds exciting. Are you considering a Python 3 port? It might make a
> nice demo of PEP 3156.
>
>
> On Monday, January 7, 2013, rbit wrote:
>>
>> I would like to announce Datagram Transport Layer Security for
>> Python. From the top of the project README:
>>
>> PyDTLS brings Datagram Transport Layer Security (DTLS - RFC 6347:
>> http://tools.ietf.org/html/rfc6347) to the Python environment. In a
>> nutshell, DTLS brings security (encryption, server authentication,
>> user authentication, and message authentication) to UDP datagram
>> payloads in a manner equivalent to what SSL/TLS does for TCP stream
>> content.
>>
>> DTLS is now very easy to use in Python. If you're familiar with the
>> ssl module in Python's standard library, you already know how. All it
>> takes is passing a datagram/UDP socket to the *wrap_socket* function
>> instead of a stream/TCP socket. Here's how one sets up the client side
>> of a connection:
>>
>>     import ssl
>>     from socket import socket, AF_INET, SOCK_DGRAM
>>     from dtls import do_patch
>>     do_patch()
>>     sock = ssl.wrap_socket(socket(AF_INET, SOCK_DGRAM))
>>     sock.connect(('foo.bar.com', 1234))
>>     sock.send('Hi there')
>>
>> The project is hosted at https://github.com/rbit/pydtls, and licensed
>> under
>> the Apache license 2.0. PyPI has packages. I can be reached
>> at code AT liquibits DOT com for questions, feedback, etc.
>>
>> <P><A HREF="http://pypi.python.org/pypi/Dtls/0.1.0">Dtls 0.1.0</A> -
>>       Datagram Transport Layer Security for Python.  (07-Jan-13)
>> --
>> http://mail.python.org/mailman/listinfo/python-announce-list
>>
>>         Support the Python Software Foundation:
>>         http://www.python.org/psf/donations/
>
>
>
> --
> --Guido van Rossum (python.org/~guido)
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: ANN: PyDTLS rbit <py@liquibits.com> - 2013-01-08 20:39 -0800

csiph-web