Skip to content

Instantly share code, notes, and snippets.

@jpic
Created April 13, 2015 12:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jpic/871140345948fdd418c5 to your computer and use it in GitHub Desktop.
Save jpic/871140345948fdd418c5 to your computer and use it in GitHub Desktop.
Problem: curl: (51) SSL: unable to obtain common name from peer certificate
root@my-ci:/etc/ssl/certs# curl -k https://google.com
Hello, World!
root@my-ci:/etc/ssl/certs# curl https://google.com
curl: (51) SSL: unable to obtain common name from peer certificate
-A PREROUTING -i lxcbr0 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8080
-A PREROUTING -i lxcbr0 -p tcp -m tcp --dport 443 -j REDIRECT --to-ports 8443
debug = 3
foreground = yes
pid =
[server]
client = no
cert= ./server.pem
accept = 0.0.0.0:8443
connect = 127.0.0.1:8080
# Run with `stunnel stunnel-mitm-proxy.conf`
#!/usr/bin/env python
def app(environ, start_response):
"""Simplest possible application object"""
data = 'Hello, World!\n'
status = '200 OK'
response_headers = [
('Content-type','text/plain'),
('Content-Length', str(len(data)))
]
start_response(status, response_headers)
return iter([data])
# Run with `gunicorn wsgi:app -b 0.0.0.0:8080`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment