Skip to content

Instantly share code, notes, and snippets.

@krzysztofjablonski
Created July 6, 2012 09:38
Show Gist options
  • Save krzysztofjablonski/3059230 to your computer and use it in GitHub Desktop.
Save krzysztofjablonski/3059230 to your computer and use it in GitHub Desktop.
Https locally with stunnel

Stunnel installation (OSX)

brew install stunnel

Certificate

openssl req -new -x509 -days 9999 -nodes -out /usr/local/etc/stunnel/stunnel.pem -keyout /usr/local/etc/stunnel/stunnel.pem
openssl x509 -subject -dates -fingerprint -in /usr/local/etc/stunnel/stunnel.pem

Stunnel configuration

tee /usr/local/etc/stunnel/stunnel.conf <<ENDOFFILE
pid        = /tmp/stunnel.pid
setuid     = nobody
setgid     = nobody
foreground = yes
client     = no
[https]
cert = /usr/local/etc/stunnel/stunnel.pem
accept = 443
connect =  80
ENDOFFILE

Run the stunnel

sudo stunnel

Open your page with https

https://ams.dev/

No warnings during using self signed certificates

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment