Use a more standard location for certificates

This commit is contained in:
rnhmjoj 2016-01-01 23:56:33 +01:00
parent 7c367b7b8a
commit eee3ee1619

View File

@ -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))