Skip to content

Instantly share code, notes, and snippets.

@rchowe
Created February 25, 2015 05:49
Show Gist options
  • Save rchowe/5675ada35157122f98a5 to your computer and use it in GitHub Desktop.
Save rchowe/5675ada35157122f98a5 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
from flask import Flask, request
app = Flask(__name__)
@app.route('/')
def home():
return 'Hello, world!\n'
@app.route('/sslinfo')
def sslinfo():
return """I know the following things about the certificate you provided:
Host: {}
X-SSL-Verified: {}
X-SSL-DN: {}
X-SSL-Client-Cert: {}
""".format(
request.headers.get('Host'),
request.headers.get('X-SSL-Verified'),
request.headers.get('X-SSL-DN'),
request.headers.get('X-SSL-Client-Cert'))
if __name__ == '__main__':
app.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment