going-flying.com gemini git repository
38dc891da51f51f338f439d4be3b5128babcf836 - Matthew Ernisse - 1595955751
add a tls test
diff --git a/cgi-bin/clientcert.py b/cgi-bin/clientcert.py new file mode 100755 index 0000000..6904868 --- /dev/null +++ b/cgi-bin/clientcert.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python3 + +import os +import sys + +if __name__ == '__main__': + if not os.environ.get('TLS_CLIENT_HASH'): + print('60 Client Certificate Requested\r\n') + sys.exit() + + print('20 text/gemini\r\n') + print(''' + +This is a CGI test. Below enumerates the environment passed by the server to the script. + +``` +''') + for k, v in os.environ.items(): + print(f'{k}={v}') + + print() + print(''' + +And below here are any parameters passed to the script itself. + +``` +''') + + print(sys.argv[1:]) + print() + print('```')