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.5

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.5
File Size Uploaded
tornado_m2crypto-0.1.5.tar.gz 78.3 kB Details

Built distribution (wheel)

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

Total release size: 114.8 kB

Release files / tornado_m2crypto-0.1.5.tar.gz

Download URL tornado_m2crypto-0.1.5.tar.gz
Size 78.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b993e84c13ff59f084860a1c6c008a11a61f0f0f27d615513501690cf683626f
BLAKE2b-256 checksum
How to use checksums
f74b5cd1a476a7365432e99329f873743bc53c8fed7064241cb3d5faf3fb88eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.14

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

Download URL tornado_m2crypto-0.1.5-py3-none-any.whl
Size 36.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9ffb7c587a4ed815f1ac0bf27f56e0671579b2928c4db6a4534e0408ce02931d
BLAKE2b-256 checksum
How to use checksums
dafe9ae288e0d7c2bdb335f9aadea63c0985bf498f79e016efe2b0aff32c3375
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.14

Release history Release notifications | RSS feed

0.1.6

2 release files

This release

0.1.5 This release

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