Is Dtls available in python3, and how to install it?

2.8k views Asked by At

From the description of Dtls library, it seems it's not available in python3. And when I want to install with pip install Dtls there's always an

Command "python setup.py egg_info" failed with error code 1 in C:\Users\sun\AppData\Local\Temp\pip-build-c_46y9mt\Dtls\

Solution here doesn't help. I am using Python 3.6 on Win7. Do I have another option for DTLS?

2

There are 2 answers

0
colidyre On

If the library you want to use is not available for the version of your interpreter, then you simply cannot use that library without porting it yourself or waiting for others doing that for you. This is probably not what you want.

This means that Dtls library works only for Python2.7 and version 1.0.0 or higher of the OpenSSL library as mentioned on the website, although it's tested on several plattforms (including yours):

At the time of initial release, PyDTLS 0.1.0 has been tested on Ubuntu 12.04.1 LTS 32-bit and 64-bit, as well as Microsoft Windows 7 32-bit and 64-bit, using CPython 2.7.3. Patches with additional platform ports are welcome.

As of release 1.2.0, PyDTLS is tested on Ubuntu 16.04 LTS as well as Microsoft Windows 10, using CPython 2.7.13.

You can use other libraries if you have to use Python3.x, e.g. standard ssl library or maybe also pyOpenSSL library:

pyOpenSSL remains the only alternative for full-featured TLS code across all noteworthy Python versions from 2.7 through 3.5 and PyPy.

Dtls is a library which simplifies implementation but you are not dependent on it. Just as a side note: For pyOpenSSL you can also get an idea how to implement it by reading this post.

0
Babu On

python3-dtls is the python3 version for dtls package.