From eee3ee16194eb31597e7a9c76d3492729292d62a Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Fri, 1 Jan 2016 23:56:33 +0100 Subject: [PATCH] Use a more standard location for certificates --- hyp/hyp.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/hyp/hyp.py b/hyp/hyp.py index 317086b..aa2cb4d 100644 --- a/hyp/hyp.py +++ b/hyp/hyp.py @@ -75,10 +75,8 @@ def serve(address, port, tls_dir, upload): bind = (address, port) try: - if upload: - server = http.HTTPServer(bind, UploadHandler) - else: - server = http.HTTPServer(bind, http.SimpleHTTPRequestHandler) + handler = UploadHandler if upload else http.SimpleHTTPRequestHandler + server = http.HTTPServer(bind, handler) if use_tls: try: context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2) @@ -120,9 +118,9 @@ def main(): help='only accept and save file as POST requests') parser.add_argument('-t', '--tls', type=str, dest='tls_dir', metavar='DIR', - default='/usr/local/etc/openssl', + default='/etc/ssl/certs', help='cert/key pair directory. Must be PEM ' 'formatted and named https-key.pem, https-cert.pem ' - '(default: /usr/local/etc/openssl)') + '(default: /etc/ssl/certs)') args = parser.parse_args() serve(**vars(args))