Skip to main content

Extension for running tornado with M2Crypto instead of the standard python SSL module

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tornado_m2crypto-0.1.1.tar.gz (75.6 kB view details)

Uploaded Source

Built Distribution

tornado_m2crypto-0.1.1-py3-none-any.whl (36.0 kB view details)

Uploaded Python 3

File details

Details for the file tornado_m2crypto-0.1.1.tar.gz.

File metadata

  • Download URL: tornado_m2crypto-0.1.1.tar.gz
  • Upload date:
  • Size: 75.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.0.post20200528 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.7.6

File hashes

Hashes for tornado_m2crypto-0.1.1.tar.gz
Algorithm Hash digest
SHA256 89c43805bb540024cd5365188f8db039a2f5cc581dd8f148a31495d744ff724a
MD5 5acca5311ee0e5322890cf3e1193e77c
BLAKE2b-256 3c911f6b9e3e427b3aab1cf1f5101e7030e11ca8d6b79949faaf67837caa50b7

See more details on using hashes here.

File details

Details for the file tornado_m2crypto-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: tornado_m2crypto-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 36.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.0.post20200528 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.7.6

File hashes

Hashes for tornado_m2crypto-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bc40465a1852f855bbf77291c75e3d32ed708adabe5074fc3d58241a93e291b8
MD5 ab8a29498e396098954668904d48b44f
BLAKE2b-256 ea88b524952868e6cf4073ac6afc11ef67f2f3512be74165325b1f7fac7cd9f7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page