By default netcat is used to check if a service is listening on a port. This is generally ok except
for services expecting SSL connections which need
to be properly closed and netcat can't do that. So here we add support for optionally using the python ssl library to create an ssl connection to the port and close it properly once finished.
Related-Bug: #1920770
(cherry picked from commit 0071e273720d65aca00b49fbde99c3b3ed1d0385)
By default netcat is used to check if a service is listening on a port. This is generally ok except for services expecting SSL connections which need to be properly closed and netcat can't do that. So here we add support for optionally using the python ssl library to create an ssl connection to the port and close it properly once finished.
Related-Bug: #1920770 (cherry picked from commit 0071e273720d65aca00b49fbde99c3b3ed1d0385)