Skip to main content

tornado_m2crypto

This extension is meant to run tornado with M2Crypto instead of the standard python SSL

Dependencies

Of course, you need M2Crypto You need a patched version of Tornado: git+https://github.com/DIRACGrid/tornado.git@iostreamConfigurable

How to use

The tornado_m2crypto/tests directory contains several examples. Basically, just take any normal https server with tornado you want, and add the following at the beginning

# Patching
# needed because some direct calls to ssl_wrap_socket in TCPServer
from tornado_m2crypto.m2netutil import m2_wrap_socket
import tornado.netutil
tornado.netutil.ssl_wrap_socket = m2_wrap_socket


# Dynamically configurable
import tornado.iostream
tornado.iostream.SSLIOStream.configure('tornado_m2crypto.m2iostream.M2IOStream')


import tornado.httputil
tornado.httputil.HTTPServerRequest.configure('tornado_m2crypto.m2httputil.M2HTTPServerRequest')

How to test

There are several types of tests.

Unit test

Almost a copy paste of the SSLIOStream tests from tornado:

tox -r

HTTPS test

A simple HTTPS server

tox -r -e m2io_https

You can then talk to you using (only requires requests package)

python test_client.py

DIRAC test

An HTTPS server converting the certificate to "DIRAC certificates"

tox -r -e m2io_dirac

You can talk to it the same way as the normal HTTPS test, and you can give it a proxy

Metadata

Release files for tornado-m2crypto 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tornado-m2crypto 0.1.6
File Size Uploaded
tornado_m2crypto-0.1.6.tar.gz 78.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tornado-m2crypto 0.1.6
File Interpreter ABI Platform
tornado_m2crypto-0.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 115.2 kB

Release files / tornado_m2crypto-0.1.6.tar.gz

Download URL tornado_m2crypto-0.1.6.tar.gz
Size 78.5 kB
Tags Source
SHA-256 checksum
How to use checksums
ba1fca6bcea5f2651560cc3a249d6fed7a4c40a9fe6b2d7fe78808cf065d5691
BLAKE2b-256 checksum
How to use checksums
8a8713724fc992369d369f73268a365f4cfabaf6f813648b0de1d36436869989
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.18

Release files / tornado_m2crypto-0.1.6-py3-none-any.whl

Download URL tornado_m2crypto-0.1.6-py3-none-any.whl
Size 36.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
123c4eed8250a945b5b7ea64d2afb0f842729455fe97a925c672a177012e4d7a
BLAKE2b-256 checksum
How to use checksums
353dce3d43ab10fe5ed97138bce3dbe9ad79e04d8fab7d8b0c5e66be1dd695ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.18

Release history Release notifications | RSS feed

This release

0.1.6 This release

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page