Skip to content

Instantly share code, notes, and snippets.

@denji
denji / golang-tls.md
Last active July 1, 2024 05:41 — forked from spikebike/client.go
Simple Golang HTTPS/TLS Examples

Moved to git repository: https://github.com/denji/golang-tls

Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
@matforest
matforest / simple-https-server.py
Last active July 31, 2021 18:02 — forked from dergachev/simple-https-server.py
Simple SSL Web Server using python's SimpleHTTPServer
# adapated from http://www.piware.de/2011/01/creating-an-https-server-in-python/
# generate seperate key+crt files, make sure common name (CN) == ip or hostname
# openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:2048 -keyout newkey.key -out newkey.crt
# run as follows:
# python simple-https-server.py
import BaseHTTPServer, SimpleHTTPServer
import ssl
# 0.0.0.0 allows connections from anywhere