diff --git a/serviceping/network.py b/serviceping/network.py index a0b4d60..df38c44 100644 --- a/serviceping/network.py +++ b/serviceping/network.py @@ -9,6 +9,7 @@ import sys from collections import OrderedDict +cipher = 'DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA:ECDHE-ECDSA-AES128-GCM-SHA256' class ScanFailed(Exception): """ @@ -88,7 +89,9 @@ def scan(host, port=80, url=None, https=False, timeout=1, max_size=65535): if https: starts['ssl'] = datetime.datetime.now() try: - network_socket = ssl.wrap_socket(network_socket) # nosec + context = ssl.create_default_context() + context.set_ciphers(cipher) + network_socket = context.wrap_socket(network_socket, server_hostname=host) # nosec except socket.timeout: raise ScanFailed('SSL socket timeout', result=result) ends['ssl'] = datetime.datetime.now() diff --git a/setup.cfg b/setup.cfg index 74753c2..09356f0 100644 --- a/setup.cfg +++ b/setup.cfg @@ -24,7 +24,7 @@ name = serviceping url = https://github.com/yahoo/serviceping # Version is YY.MM.SERIAL -version = 19.5.0 +version = 19.6.0 [options] packages =