M2Crypto is the most complete Python wrapper for OpenSSL featuring RSA, DSA, DH, HMACs, message digests, symmetric ciphers (including AES); SSL functionality to implement clients and servers; HTTPS extensions to Python's httplib, urllib, and xmlrpclib; unforgeable HMAC'ing AuthCookies for web session management; FTP/TLS client and server; S/MIME; ZServerSSL: A HTTPS server for Zope and ZSmime: An S/MIME messenger for Zope. M2Crypto can also be used to provide SSL for Twisted.

M2Crypto's unit tests cover over 80% of the Python code.

The original M2Crypto homepage is at http://sandbox.rulemaker.net/ngps/m2/. It hasn't been updated since M2Crypto 0.13.1 release.

Discuss M2Crypto on comp.lang.python newsgroup or python-list mailinglist. You can also get questions answered on stackoverflow.com (please tag questions with m2crypto tag). M2Crypto used to be discussed on the public python-crypto mailing list, but it is no longer the preferred forum. See http://listserv.surfnet.nl/archives/python-crypto.html for archives and subscription information.

Downloads

Contributed Builds

These are provided by volunteers, untested by M2Crypto author. Feel free to add contributed build links. Please mention the configuration (platform, python version, openssl version, your name and preferably also your email address). You need to register on this wiki to be able to edit.

A: It has been reported this was a problem with SWIG 1.3.30rc1, but that it works in 1.3.30 and newer.

Q: M2Crypto crashes/does not work in my multi-threaded application.

A: You need to call M2Crypto.threading.init() to initialize threading mode before use, and cleanup() to end threading support.

Q: I have OpenSSL in non-standard location, how can I build M2Crypto?

A: build_ext takes --openssl option to specify openssl directory prefix. However, there have been some reports that this is not always enough, and you need to also explicitly specify --library-dirs and --include-dirs options. So the full build and install command would be something like: python setup.py build_ext --openssl=<openssl prefix> --library-dirs=<openssl prefix>/lib --include-dirs=<openssl prefix>/include build install.

Q: I still can't build on a Fedora Core -based system, any workarounds?

General

Q: Why is OSAF providing limited hosting to M2Crypto?

A: M2Crypto did not have public source repository nor bug database, which made it hard to contribute to it and keep track of issues. M2crypto is an integral part of OSAF's Chandler application and we have made and will continue to make changes to it, but we did not want to fork M2Crypto. We believe everyone will benefit by working on and improving the same official version.

Q: Will you host M2Crypto permanently?

A: We'll provide hosting as long as needed and/or we are able to do so. If some other hosting arrangement makes sense, we can switch to that in the future.

Q: My project X does not have a public source archive or Bugzilla, can you provide hosting for it?

A: Short answer: no. We do not intend to become a project hosting facility. We made an exception with M2Crypto because we use it in Chandler and intend to make lots of changes. If your project is used in Chandler and we feel like we would need to modify it a lot, we could consider it. But even then we'd ask you to first see if you could use some public project hosting facility like SourceForge.