skip to navigation
skip to content

Not Logged In

backports.ssl 0.0.2

The Python 3.4 standard `ssl` module API implemented on top of pyOpenSSL

Latest Version: 0.0.7


What is it?

It's the Python 3.4 standard ``ssl`` module API implemented on top of

import backports.ssl as ssl
import socket

context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
context.verify_mode = ssl.CERT_REQUIRED

conn = context.wrap_socket(socket.socket(socket.AF_INET))
conn.connect(('', 443))
print conn.getpeercert()


Because the latest web technologies should be available to those running older
versions of Python.

Isn't this obsoleted by `PEP 466`_?

If you're on Python 2.7, then probably. But PEP 466 doesn't cover Python 2.6,
3.2, or 3.3, and the ``ssl.RAND_*()`` functions are explicitly out of scope.
This package supports it all.

How do I use it with third-party libraries?

Monkey-patching support is included a la `gevent`_::

import backports.ssl.monkey as monkey
import requests


Why am I getting ``AttributeError``\ s for newer features?

Like the standard ``ssl`` module, certain attributes will not be available if
your OpenSSL does not support them. See `Installing OpenSSL`_ for instructions.

Installing OpenSSL


- Verify that we play nicely with gevent's monkey-patching.
- Backport and pass the standard Python ``ssl`` test suite.
- If not that, automate testing against hyper, urllib3, requests, and Tornado
test suites.
- Use the bundled 3.x OpenSSL, if available and newer than the default.

.. _`PEP 466`:
.. _`gevent`:  
File Type Py Version Uploaded on Size
backports.ssl-0.0.2.tar.gz (md5) Source 2014-04-11 9KB
  • Downloads (All Versions):
  • 31 downloads in the last day
  • 157 downloads in the last week
  • 797 downloads in the last month