INNER CODE UNIT · Python
testssl_analysis
rfc-st/humble · humble.py:510
def testssl_analysis(testssl_cmd):
"""Run TLS/SSL analysis with testssl.sh, related to `-e` option.
??? note
This function is safe from injection: `shell=True` is not used,
arguments are passed as a list and `testssl.sh` options are defined in
the `TESTSSL_OPTIONS` constant.
"""
try:
# nosemgrep: dangerous-subprocess-use-audit
with Popen(testssl_cmd, stdout=PIPE, stderr=STDOUT,
text=True) as process: # false-positive
for ln in iter(process.stdout.readline, ""):
print(ln, end="")
if "Done" in ln:
process.terminate()
break
except (OSError, ValueError):