mirror of
https://github.com/theupdateframework/python-tuf
synced 2026-05-24 10:08:28 +00:00
Test: adjust proxy_server.py argument handling:
- if it is provided, don't require the certificate filename to be provided as an absolute path - raise an error if the provided certificate filename does not point to an existing file, rather than just printing and ignoring (to avoid possible future diagnostic headaches) Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
This commit is contained in:
parent
d69f9a2160
commit
2b97c0e59c
1 changed files with 2 additions and 4 deletions
|
|
@ -477,12 +477,10 @@ def test(HandlerClass=ProxyRequestHandler, ServerClass=ThreadingHTTPServer, prot
|
|||
# MODIFIED: Argument added to control certificate(s) the proxy expects of
|
||||
# the target server(s), and added default value.
|
||||
if len(sys.argv) > 3:
|
||||
if not os.path.isabs(sys.argv[3]):
|
||||
print('Path for target server cert is not absolute. Ignoring.')
|
||||
elif os.path.exists(sys.argv[3]):
|
||||
if os.path.exists(sys.argv[3]):
|
||||
TARGET_SERVER_CA_FILEPATH = sys.argv[3]
|
||||
else:
|
||||
print('Target server cert not found. Ignoring.')
|
||||
raise Exception('Target server cert file not found: ' + sys.argv[3])
|
||||
|
||||
# MODIFIED: Create the target-host-specific proxy certificates directory if
|
||||
# it doesn't already exist.
|
||||
|
|
|
|||
Loading…
Reference in a new issue