circuitpython-https-server/scripts/generate-single-certificate.sh
James Ide 86009ef6ae
Add an example server (very slow)
This implements a simple HTTP and HTTPS server pair that serve a static HTML file. The HTTP server uses adafruit_httpserver in a straightforward, basic way. The HTTPS server works by wrapping a socket pool object in an object that wraps all sockets in SSLSockets.

There are throwaway, self-signed certificates for testing under src/certificates. However, HTTPS is very slow. Probably need an optimized AES implementation.
2023-03-01 19:55:58 -08:00

11 lines
418 B
Bash
Executable file

#!/usr/bin/env bash
set -euo pipefail
script_directory="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Derived from https://www.linode.com/docs/guides/create-a-self-signed-tls-certificate/
openssl req -new -newkey rsa:1024 -x509 -sha256 -days 365 -nodes \
-subj '/CN=picow.local' \
-out "$script_directory/../src/certificates/certificate-chain.pem" \
-keyout "$script_directory/../src/certificates/key.pem"