Certificate Generator

This is a simple program to generate self signed certificates for hosting applications providing https services

Usage

Execution is a simple docker command line
docker run -it -v /data:{FolderToStoreCert} ghcr.io/thecuriousgeek/cert-gen -o /data/{OutputPrefix}-h {HostName} -h {HostName2}...

This would generate the certificate ({OutputPrefix}.crt and .key) in the {FolderToStoreCert} directory

Using Certificates

Caddy

In your Caddyfile have the following lines
#Assuming the certificate is in /cert/caddy.crt and /cert/caddy.key https://*.MyDomain { tls /cert/caddy.crt /cert/caddy.key @app host app.* handle @app { reverse_proxy localhost:80 } }

Python app with FastAPI

#Assume that the cert and key files are in ./mydomain.crt and ./mydomain.key _Config = uvicorn.Config(App,host='0.0.0.0',port=_Port,log_level='warning',ssl_certfile='mydomain.crt',ssl_keyfile='mydomain.key') _Server = uvicorn.Server(_Config) _Server.serve()