Skip to main content

Hypercorn + Easy https:// with SNI

Project description

Snipercorn

Hypercorn + SNI (multiple SSL certificates per server) + easy letsencrypt integration

Snipercorn is a layer on top of the Hypercorn web server designed to make it as easy as possible to use https:// with your Python project. It extends Hypercorn’s Config class to look for a tree of certificates in a layout compatible with the dehydrated ACME / letsencrypt client (https://dehydrated.io), making it easier for any project on the public web to run with a real https certificate.

Usage

Download dehydrated.io client.

Make config directory ~/etc/dehydrated/config:

CA="https://acme-v02.api.letsencrypt.org/directory"
CHALLENGETYPE="tls-alpn-01"

Snipercorn can serve the tls-alpn-01 challenge type.

~/etc/dehydrated/domains.txt should contain the fqdn of your server and desired alternate names:

example.com www.example.com

Start snipercorn:

authbind python -m snipercorn fileserver.py -b :::443 --sni ~/etc/dehydrated

Run dehydrated to get certificates:

dehydrated -f ~/etc/dehydrated/config --register --accept-terms # once
dehydrated -f ~/etc/dehydrated/config -c    # auto-renews when necessary

Alternate names may not work. If it doesn’t work, try just one domain in domains.txt. Remember your domain has to be reachable from the CA (letsencrypt) server on port 443.

Visit your new site.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

snipercorn-0.0.1-py2.py3-none-any.whl (6.7 kB view hashes)

Uploaded Python 2 Python 3

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