This commit is contained in:
Kovid Goyal 2016-06-22 13:26:34 +05:30
parent 660bff01da
commit 37b4001c63

View File

@ -179,8 +179,8 @@ class LoopTest(BaseTest):
@skipIf(create_server_cert is None, 'certgen module not available')
def test_ssl(self):
'Test serving over SSL'
s = socket.socket(socket.AF_INET6, socket.SOCK_STREAM, 0)
s.bind(('::1', 0))
s = socket.socket(socket.AF_INET if is_travis else socket.AF_INET6, socket.SOCK_STREAM, 0)
s.bind(('localhost', 0))
address = s.getsockname()[0]
with TemporaryDirectory('srv-test-ssl') as tdir:
cert_file, key_file, ca_file = map(lambda x:os.path.join(tdir, x), 'cka')