From 6ad73061c451bfe58cb41757d788925810ad4167 Mon Sep 17 00:00:00 2001 From: TheSomeMan Date: Sun, 5 May 2024 22:48:49 +0700 Subject: [PATCH] scripts/http_server_auth.py: Add command line arguments '--cert', '--key' and '--ca_cert' for compatibility with 'curl' --- scripts/http_server_auth.py | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/scripts/http_server_auth.py b/scripts/http_server_auth.py index e8538f6..5185fb5 100755 --- a/scripts/http_server_auth.py +++ b/scripts/http_server_auth.py @@ -473,16 +473,34 @@ def httpd_run(HandlerClass=BaseHTTPRequestHandler, help="Just accept a connection, don't serve anything", ) parser.add_argument( - "--ssl_cert", + "--cert", + dest="ssl_cert", help="Path to server.pem (for HTTPS), if it contains private key, then --ssl_key is not needed", ) parser.add_argument( - "--ssl_key", + "--ssl_cert", # --cert + dest="ssl_cert", + help="The same as --cert, for compatibility with python -m http.server", + ) + parser.add_argument( + "--key", + dest="ssl_key", help="Path to server_key.pem (for HTTPS)", ) parser.add_argument( - "--ca_cert", - help="Path to ca_cert.pem (for HTTPS)", + "--ssl_key", # --key + dest="ssl_key", + help="The same as --key, for compatibility with python -m http.server", + ) + parser.add_argument( + "--cacert", + dest="ca_cert", + help="Path to ca_cert.pem (certificate authority file) (for HTTPS)", + ) + parser.add_argument( + "--ca_cert", # --cacert + dest="ca_cert", + help="The same as --cacert, for compatibility with python -m http.server", ) parser.add_argument("--username", "-u", metavar="USERNAME") parser.add_argument("--password", "-p", metavar="PASSWORD")