Skip to content

Instantly share code, notes, and snippets.

@saurabh-hirani
Created April 14, 2019 15:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saurabh-hirani/170f1ea954f0c97679e8aa7b7bd2da7e to your computer and use it in GitHub Desktop.
Save saurabh-hirani/170f1ea954f0c97679e8aa7b7bd2da7e to your computer and use it in GitHub Desktop.
#!/bin/bash
cn='example.com'
host="0.0.0.0"
port=8082
openssl genrsa -out /tmp/$cn.key 2048
openssl req -new -x509 -sha256 -key /tmp/$cn.key -out /tmp/$cn.crt -days 3650 \
-subj "/CN=$cn\/emailAddress=admin@$cn/C=US/ST=Ohio/L=Columbus/O=Widgets Inc/OU=Some Unit"
docker run --rm -e HTTPS_CERT_FILE='/tmp/example.com.crt' -e HTTPS_KEY_FILE='/tmp/example.com.key' -e PORT=$port -p $port:$port -v /tmp:/tmp mccutchen/go-httpbin:v2.1.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment