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) (cherry picked from commit f9912337783aec2a974bb6a3d49e4ed717d0c521) (cherry picked from commit 4a65a1b74375eb114e22d743da18c96490db22cb) (cherry picked from commit 2869ac5b396fc502288585cb83af7e55a18d7d5c)
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) (cherry picked from commit f9912337783aec2a974bb6a3d49e4ed717d0c521) (cherry picked from commit 4a65a1b74375eb114e22d743da18c96490db22cb) (cherry picked from commit 2869ac5b396fc502288585cb83af7e55a18d7d5c)