Skip to content

Instantly share code, notes, and snippets.

@swinton
Created November 12, 2014 19:26
Show Gist options
  • Select an option

  • Save swinton/9461517c41dc58e4cc6c to your computer and use it in GitHub Desktop.

Select an option

Save swinton/9461517c41dc58e4cc6c to your computer and use it in GitHub Desktop.
Stunnel HOWTO

Basically:

Install stunnel

brew install stunnel

Create /usr/local/etc/stunnel/stunnel.pem

openssl genrsa -out key.pem 2048
openssl req -new -x509 -key key.pem -out cert.pem -days 1095

Create dev_https

This one will tunnel traffic from https://localhost/ to some remote non-HTTPS server, http://192.168.33.42/.

cat >> dev_https
pid=

cert=/usr/local/etc/stunnel/stunnel.pem
foreground=yes
debug=3

[https]
accept=443
connect=192.168.33.42:80
TIMEOUTclose=1

Run stunnel dev_https

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