{ "info": { "author": "Ilya Kreymer", "author_email": "ikreymer@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Utilities" ], "description": "Certificate Authority Certificate Maker Tools\n=============================================\n\n.. image:: https://travis-ci.org/ikreymer/certauth.svg?branch=master\n :target: https://travis-ci.org/ikreymer/certauth\n.. image:: https://coveralls.io/repos/ikreymer/certauth/badge.svg?branch=master\n :target: https://coveralls.io/r/ikreymer/certauth?branch=master\n\nThis package provides a small library, built on top of ``pyOpenSSL``, which allows for creating a custom certificate authority certificate,\nand genereating on-demand dynamic host certs using that CA certificate.\n\nIt is most useful for use with a man-in-the-middle HTTPS proxy, for example, for recording or replaying web content.\n\nTrusting the CA created by this tool should be used with caution in a controlled setting to avoid security risks.\n\n\nCertificateAuthority API\n============================\n\nThe ``CertificateAuthority`` class provides an interface to manage a root CA and generate dynamic host certificates suitable\nfor use with the native Python ``ssl`` library as well as pyOpenSSL ``SSL`` module.\n\nThe class provides several options for storing the root CA and generated host CAs.\n\n\nFile-based Certificate Cache\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n.. code:: python\n\n ca = CertificateAuthority('My Custom CA', 'my-ca.pem', cert_cache='/tmp/certs')\n filename = ca.cert_for_host('example.com')\n\nIn this configuration, the root CA is stored at ``my-ca.pem`` and dynamically generated certs\nare placed in ``/tmp/certs``. The ``filename`` returned would be ``/tmp/certs/example.com.pem`` in this example.\n\nThis filename can then be used with the Python `ssl.load_cert_chain(certfile) `_ command.\n\nNote that the dynamically created certs are never deleted by ``certauth``, it remains up to the user to handle cleanup occasionally if desired.\n\n\nIn-memory Certificate Cache\n~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n.. code:: python\n\n ca = CertificateAuthority('My Custom CA', 'my-ca.pem', cert_cache=50)\n cert, key = ca.load_cert('example.com')\n\nThis configuration stores the root CA at ``my-ca.pem`` but uses an in-memory certificate cache for dynamically created certs. \nThese certs are stored in an LRU cache, configured to keep at most 50 certs.\n\nThe ``cert`` and ``key`` can then be used with `OpenSSL.SSL.Context.use_certificate `_\n\n.. code:: python\n\n context = SSl.Context(...)\n context.use_privatekey(key)\n context.use_certificate(cert)\n\n\nCustom Cache\n~~~~~~~~~~~~\n\nA custom cache implementations which stores and retrieves per-host certificates can also be provided:\n\n.. code:: python\n\n ca = CertificateAuthority('My Custom CA', 'my-ca.pem', cert_cache=CustomCache())\n cert, key = ca.load_cert('example.com')\n\n class CustomCache:\n def __setitem__(self, host, cert_string):\n # store cert_string for host\n\n def get(self, host):\n # return cached cert_string, if available\n cert_string = ...\n return cert_string\n\n\nWildcard Certs\n~~~~~~~~~~~~~~\n\nTo reduce the number of certs generated, it is convenient to generate wildcard certs.\n\n.. code:: python\n\n cert, key = ca.load_cert('example.com', wildcard=True)\n\nThis will generate a cert for ``*.example.com``.\n\nTo automatically generate a wildcard cert for parent domain, use:\n\n.. code:: python\n\n cert, key = ca.load_cert('test.example.com', wildcard=True, wildcard_for_parent=True)\n\nThis will also generate a cert for ``*.example.com``\n\nStarting with 1.3.0, ``certauth`` uses ``tldextract`` to determine the tld for a given host,\nand will not use a parent domain if it is itself a tld suffix.\n\nFor example, calling:\n\n.. code:: python\n\n cert, key = ca.load_cert('example.co.uk', wildcard=True, wildcard_for_parent=True)\n\nwill now result in a cert for ``*.example.co.uk``, not ``*.co.uk``.\n\n\nCLI Usage Examples\n==================\n\n``certauth`` also includes a simple command-line API for certificate creation and management.\n\n::\n\n usage: certauth [-h] [-c CERTNAME] [-n HOSTNAME] [-d CERTS_DIR] [-f] [-w]\n root_ca_cert\n\n positional arguments:\n root_ca_cert Path to existing or new root CA file\n\n optional arguments:\n -h, --help show this help message and exit\n -c CERTNAME, --certname CERTNAME\n Name for root certificate\n -n HOSTNAME, --hostname HOSTNAME\n Hostname certificate to create\n -d CERTS_DIR, --certs-dir CERTS_DIR\n Directory for host certificates\n -f, --force Overwrite certificates if they already exist\n -w, --wildcard_cert add wildcard SAN to host: *., \n\n\n\nTo create a new root CA certificate:\n\n``certauth myrootca.pem --certname \"My Test CA\"``\n\nTo create a host certificate signed with CA certificate in directory ``certs_dir``:\n\n``certauth myrootca.pem --hostname \"example.com\" -d ./certs_dir``\n\nIf the root cert doesn't exist, it'll be created automatically.\nIf ``certs_dir``, doesn't exist, it'll be created automatically also.\n\nThe cert for ``example.com`` will be created as ``certs_dir/example.com.pem``.\nIf it already exists, it will not be overwritten (unless ``-f`` option is used).\n\nThe ``-w`` option can be used to create a wildcard cert which has subject alternate names (SAN) for ``example.com`` and ``*.example.com``\n\n\nHistory\n=======\n\nThe CertificateAuthority functionality has evolved from certificate management originally found in the man-in-the-middle proxy `pymiproxy `_ by Nadeem Douba.\n\nIt was also extended in `warcprox `_ by `Noah Levitt `_ of Internet Archive.\n\nThe CA functionality was also reused in `pywb `_ and finally factored out into this separate package for modularity.\n\nIt is now also used by `wsgiprox `_ to provide a generalized HTTPS proxy wrapper to any WSGI application.\n\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ikreymer/certauth", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "certauth", "package_url": "https://pypi.org/project/certauth/", "platform": "", "project_url": "https://pypi.org/project/certauth/", "project_urls": { "Homepage": "https://github.com/ikreymer/certauth" }, "release_url": "https://pypi.org/project/certauth/1.3.0/", "requires_dist": [ "pyopenssl", "tldextract" ], "requires_python": "", "summary": "Simple Certificate Authority for MITM proxies", "version": "1.3.0" }, "last_serial": 5642569, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "c1f4ba2edd57ca5e40703b618c39ed4c", "sha256": "bcbae76d71a4d836c148d8c1edad788d4df3dfd74734e24e9bfdfd46dd7b353f" }, "downloads": -1, "filename": "certauth-1.0.tar.gz", "has_sig": false, "md5_digest": "c1f4ba2edd57ca5e40703b618c39ed4c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4301, "upload_time": "2015-03-30T00:08:11", "url": "https://files.pythonhosted.org/packages/ba/c5/70b6cd2b2643dfd2f0cf385d238879f2ff7824300e6d35ef6760a91fbaa6/certauth-1.0.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "8c884da97ddb143cbf9f3ddecabea506", "sha256": "da7f297ed60e14a9722e578c1f3e241d4c87ccc166f6d9d2e63ad9f99e3baad2" }, "downloads": -1, "filename": "certauth-1.1.0.tar.gz", "has_sig": false, "md5_digest": "8c884da97ddb143cbf9f3ddecabea506", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4976, "upload_time": "2015-03-30T16:25:51", "url": "https://files.pythonhosted.org/packages/3a/9e/645ce357213c16848b296004177dc477ea0a9e27de2fbf17fbb7928f2262/certauth-1.1.0.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "b5fd3f3cb849c4b5e1bbe89a5d4aac0d", "sha256": "0b2ae3667e5b4da99af9dd1404d50edca2b8798181b68b7a172026e2fa21e015" }, "downloads": -1, "filename": "certauth-1.1.1.tar.gz", "has_sig": false, "md5_digest": "b5fd3f3cb849c4b5e1bbe89a5d4aac0d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5145, "upload_time": "2015-03-30T22:42:12", "url": "https://files.pythonhosted.org/packages/93/1c/2773902d313b194254afb6ba9d4f04de21b62bf9c2ef000e065fced483ff/certauth-1.1.1.tar.gz" } ], "1.1.2": [ { "comment_text": "", "digests": { "md5": "6601cb27a98613c1fa4dc80bcc32f901", "sha256": "194815d41d20a0fc78d45fe461174985884dc84919e8765e80f857ba68c696c6" }, "downloads": -1, "filename": "certauth-1.1.2.tar.gz", "has_sig": false, "md5_digest": "6601cb27a98613c1fa4dc80bcc32f901", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5177, "upload_time": "2015-11-10T02:22:04", "url": "https://files.pythonhosted.org/packages/0d/e4/a625e7761396ba8da39166091b188f45c4ad38f15567f3cfc6404108ecbe/certauth-1.1.2.tar.gz" } ], "1.1.3": [ { "comment_text": "", "digests": { "md5": "579d69ce8422b4671c7e80c2b8af87de", "sha256": "64a2cd09870377dd2601353969617ebb424d94a8ab21d5ccdb93b9bf41cf3578" }, "downloads": -1, "filename": "certauth-1.1.3.tar.gz", "has_sig": false, "md5_digest": "579d69ce8422b4671c7e80c2b8af87de", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5201, "upload_time": "2015-11-12T17:56:45", "url": "https://files.pythonhosted.org/packages/f9/20/3b34db694bb8e89e763dd42c5bbc89db29634e24cb4c880a4d7c9863dd1a/certauth-1.1.3.tar.gz" } ], "1.1.4": [ { "comment_text": "", "digests": { "md5": "ce8f3ba967fa53b83f29d643fe1b5fce", "sha256": "cf42b6d720859193ad55aa22e5b680af3f18ec9000906187ab341a247fca0b88" }, "downloads": -1, "filename": "certauth-1.1.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "ce8f3ba967fa53b83f29d643fe1b5fce", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7166, "upload_time": "2017-04-19T04:36:36", "url": "https://files.pythonhosted.org/packages/d1/3b/71f6f15d721db10d24dea03b599c0204f0ccc6ff34c5dffed617c7098ef3/certauth-1.1.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "521299a0d4d1d4d3e196e0d38bcfdc57", "sha256": "a28cad60108041a75b4d1f089577142c3f59f21ef6911ffd2e7865c8c87a31dc" }, "downloads": -1, "filename": "certauth-1.1.4.tar.gz", "has_sig": false, "md5_digest": "521299a0d4d1d4d3e196e0d38bcfdc57", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5189, "upload_time": "2017-04-19T04:36:57", "url": "https://files.pythonhosted.org/packages/c7/34/c575346d09b4c9a46666f2c0f9783a2858d3dbc9453fbeaefee603603330/certauth-1.1.4.tar.gz" } ], "1.1.5": [ { "comment_text": "", "digests": { "md5": "bdbef68fb189c7ac89a95ecc350fc82c", "sha256": "1ee05098bfa9362ccbc369801e06205d500b689ba23610945dc4ac20dd5ceb96" }, "downloads": -1, "filename": "certauth-1.1.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "bdbef68fb189c7ac89a95ecc350fc82c", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7311, "upload_time": "2017-05-09T21:44:22", "url": "https://files.pythonhosted.org/packages/1b/cc/9796fa03345ed0cea15e1c64e2fd45caf247299ce130cb8022c91d5d7ded/certauth-1.1.5-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "02ff8a7dea7dea3df5cec7ef5933629a", "sha256": "f5c081d2ba4a23010096902c5696577cc88e425aa9a82a5317619eff6e71f694" }, "downloads": -1, "filename": "certauth-1.1.5.tar.gz", "has_sig": false, "md5_digest": "02ff8a7dea7dea3df5cec7ef5933629a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5551, "upload_time": "2017-05-09T21:44:34", "url": "https://files.pythonhosted.org/packages/e1/40/aa4e48c40c2adb0ffb3968d2604b0915c341f9f5547fa431ad91b1d316ba/certauth-1.1.5.tar.gz" } ], "1.1.6": [ { "comment_text": "", "digests": { "md5": "0779689c2040d115411c4624c322679f", "sha256": "b8df2e83002ba5ad57ed81c7f091c20615227d638751972c5d15a8c424440b2e" }, "downloads": -1, "filename": "certauth-1.1.6-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "0779689c2040d115411c4624c322679f", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7341, "upload_time": "2017-05-11T16:24:13", "url": "https://files.pythonhosted.org/packages/fa/e8/7addaa6f57939e1acd5de0e21dd4b6beec98bbaf32f1f644ca612dd9d993/certauth-1.1.6-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "dba615705982be1144be98bc78e63d25", "sha256": "ea26e66c2e1286a5089d6b619fcfa4155427928d24b5f8f648b84436b8a06c4b" }, "downloads": -1, "filename": "certauth-1.1.6.tar.gz", "has_sig": false, "md5_digest": "dba615705982be1144be98bc78e63d25", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5592, "upload_time": "2017-05-11T16:24:16", "url": "https://files.pythonhosted.org/packages/eb/53/ce43154e0967f3443a1e44bc745dbcae438b8484e227b7dd39600283b93c/certauth-1.1.6.tar.gz" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "e37dac35ac5b6b10382b6279e8a42310", "sha256": "6987fca6e4d30a634954e60fed6747a93c5715e87db60d233df9d798a15fe346" }, "downloads": -1, "filename": "certauth-1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e37dac35ac5b6b10382b6279e8a42310", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10035, "upload_time": "2017-05-17T00:34:20", "url": "https://files.pythonhosted.org/packages/df/a0/e43be41cc219fed7adfd65e17e8a443e1212d27be151e8a77dfa14f5e6f9/certauth-1.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0b60046924ec8bee726bb85c1c9307bb", "sha256": "66bc151d49fa75e2384b2cf26107e2fc453f13051d1952f3628ee33b6918d5cc" }, "downloads": -1, "filename": "certauth-1.2.tar.gz", "has_sig": false, "md5_digest": "0b60046924ec8bee726bb85c1c9307bb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7955, "upload_time": "2017-05-17T00:33:49", "url": "https://files.pythonhosted.org/packages/58/36/21576d42f81c59e40d599924605268283a1d1d1e984774dee66750fea401/certauth-1.2.tar.gz" } ], "1.2.1": [ { "comment_text": "", "digests": { "md5": "04abd7578c8bad010724d2ac0de6d391", "sha256": "f33cb733499da3bb81ac937ed4284b3ff6a5f275ccb72dc34773775d1361efd2" }, "downloads": -1, "filename": "certauth-1.2.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "04abd7578c8bad010724d2ac0de6d391", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10205, "upload_time": "2018-10-21T05:29:06", "url": "https://files.pythonhosted.org/packages/99/98/2d989c309cb30960e6276de0aee67c96c711b8f83586050772702132ad6d/certauth-1.2.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d795b86c13837d699ef59114b8356d20", "sha256": "47d0a4c3214a49d6fa7c5708a1fcfc5d86c718cc089fcdb7ecc1ad350aa0fad1" }, "downloads": -1, "filename": "certauth-1.2.1.tar.gz", "has_sig": false, "md5_digest": "d795b86c13837d699ef59114b8356d20", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10277, "upload_time": "2018-10-21T05:29:08", "url": "https://files.pythonhosted.org/packages/37/60/bb989e65a6b4978562ed6abf1cc4c027f2180affe72393c81525df4195b7/certauth-1.2.1.tar.gz" } ], "1.2.2": [ { "comment_text": "", "digests": { "md5": "a4b5c377a035df19e02012a75738dac9", "sha256": "5df76f2ee95204bb61bec7277567743938d050eb4f4f07232f5b02de7048973e" }, "downloads": -1, "filename": "certauth-1.2.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a4b5c377a035df19e02012a75738dac9", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7960, "upload_time": "2019-03-21T17:21:17", "url": "https://files.pythonhosted.org/packages/07/9e/425a5b38cba37673e8deeaaa8d54763fdc2fe8fc4dd81380455419211d3f/certauth-1.2.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "acdce710903ff94cf4fea9cf5d0956ef", "sha256": "b3819c3dfe6f1710b340397326bc297ec0cdc42064397892563ac2848f87d1f6" }, "downloads": -1, "filename": "certauth-1.2.2.tar.gz", "has_sig": false, "md5_digest": "acdce710903ff94cf4fea9cf5d0956ef", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8496, "upload_time": "2019-03-21T17:21:18", "url": "https://files.pythonhosted.org/packages/fa/06/dd864b1845582d21ac46656cc3c965509e2173f73143b5c10ce6f115fc8b/certauth-1.2.2.tar.gz" } ], "1.3.0": [ { "comment_text": "", "digests": { "md5": "47e52893ff8357145d6d70d4aa0dc9c7", "sha256": "f84b8c7075d0e445614d5ec4662056511453f19228cf4fcf8278cccae17b316b" }, "downloads": -1, "filename": "certauth-1.3.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "47e52893ff8357145d6d70d4aa0dc9c7", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10595, "upload_time": "2019-08-07T01:30:56", "url": "https://files.pythonhosted.org/packages/18/6a/748f61932188f9bfc7685089d9a83b36e239b828aeb610661871d4342917/certauth-1.3.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bd9803e4c911a9ba67bde96514067f93", "sha256": "7862d5deff0b33d2fb28d36861ba63d91c82d700bfdfc4bd848a8711ca72b8fb" }, "downloads": -1, "filename": "certauth-1.3.0.tar.gz", "has_sig": false, "md5_digest": "bd9803e4c911a9ba67bde96514067f93", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10798, "upload_time": "2019-08-07T01:30:58", "url": "https://files.pythonhosted.org/packages/5c/ff/48bdb93555bf93708100be50622ba6ff93d7026e9e172b9e8ab92c2ae8f1/certauth-1.3.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "47e52893ff8357145d6d70d4aa0dc9c7", "sha256": "f84b8c7075d0e445614d5ec4662056511453f19228cf4fcf8278cccae17b316b" }, "downloads": -1, "filename": "certauth-1.3.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "47e52893ff8357145d6d70d4aa0dc9c7", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10595, "upload_time": "2019-08-07T01:30:56", "url": "https://files.pythonhosted.org/packages/18/6a/748f61932188f9bfc7685089d9a83b36e239b828aeb610661871d4342917/certauth-1.3.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bd9803e4c911a9ba67bde96514067f93", "sha256": "7862d5deff0b33d2fb28d36861ba63d91c82d700bfdfc4bd848a8711ca72b8fb" }, "downloads": -1, "filename": "certauth-1.3.0.tar.gz", "has_sig": false, "md5_digest": "bd9803e4c911a9ba67bde96514067f93", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10798, "upload_time": "2019-08-07T01:30:58", "url": "https://files.pythonhosted.org/packages/5c/ff/48bdb93555bf93708100be50622ba6ff93d7026e9e172b9e8ab92c2ae8f1/certauth-1.3.0.tar.gz" } ] }