Added -k parameter to curl to ignore self signed SSL certificate
This commit is contained in:
parent
13ea25bff5
commit
05cc28c119
1 changed files with 3 additions and 3 deletions
|
@ -215,13 +215,13 @@ def upload_via_http_gate_curl(
|
||||||
# pre-clean
|
# pre-clean
|
||||||
_cmd_run("rm pipe -f")
|
_cmd_run("rm pipe -f")
|
||||||
files = f"file=@pipe;filename={os.path.basename(filepath)}"
|
files = f"file=@pipe;filename={os.path.basename(filepath)}"
|
||||||
cmd = f"mkfifo pipe;cat {filepath} > pipe & curl --no-buffer -F '{files}' {attributes} {request}"
|
cmd = f"mkfifo pipe;cat {filepath} > pipe & curl -k --no-buffer -F '{files}' {attributes} {request}"
|
||||||
output = _cmd_run(cmd, LONG_TIMEOUT)
|
output = _cmd_run(cmd, LONG_TIMEOUT)
|
||||||
# clean up pipe
|
# clean up pipe
|
||||||
_cmd_run("rm pipe")
|
_cmd_run("rm pipe")
|
||||||
else:
|
else:
|
||||||
files = f"file=@{filepath};filename={os.path.basename(filepath)}"
|
files = f"file=@{filepath};filename={os.path.basename(filepath)}"
|
||||||
cmd = f"curl -F '{files}' {attributes} {request}"
|
cmd = f"curl -k -F '{files}' {attributes} {request}"
|
||||||
output = _cmd_run(cmd)
|
output = _cmd_run(cmd)
|
||||||
|
|
||||||
if error_pattern:
|
if error_pattern:
|
||||||
|
@ -246,7 +246,7 @@ def get_via_http_curl(cid: str, oid: str, endpoint: str) -> str:
|
||||||
request = f"{endpoint}/get/{cid}/{oid}"
|
request = f"{endpoint}/get/{cid}/{oid}"
|
||||||
file_path = os.path.join(os.getcwd(), ASSETS_DIR, f"{cid}_{oid}_{str(uuid.uuid4())}")
|
file_path = os.path.join(os.getcwd(), ASSETS_DIR, f"{cid}_{oid}_{str(uuid.uuid4())}")
|
||||||
|
|
||||||
cmd = f"curl {request} > {file_path}"
|
cmd = f"curl -k {request} > {file_path}"
|
||||||
_cmd_run(cmd)
|
_cmd_run(cmd)
|
||||||
|
|
||||||
return file_path
|
return file_path
|
||||||
|
|
Loading…
Reference in a new issue