Better fix for IPv6 binding to localhost

This commit is contained in:
Kovid Goyal 2016-06-22 13:04:03 +05:30
parent 41541a4385
commit 660bff01da

View File

@ -180,7 +180,7 @@ class LoopTest(BaseTest):
def test_ssl(self):
'Test serving over SSL'
s = socket.socket(socket.AF_INET6, socket.SOCK_STREAM, 0)
s.bind(('localhost', 1338 if is_travis else 0))
s.bind(('::1', 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')