From d462e4093e3134cc137f64d8ed1828227ab4aea4 Mon Sep 17 00:00:00 2001 From: Pablo Galindo Date: Sat, 20 Oct 2018 17:59:39 +0100 Subject: [PATCH 1/3] Fix test_start_tls_server_1 on FreeBSD buildbots --- Lib/test/test_asyncio/test_sslproto.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Lib/test/test_asyncio/test_sslproto.py b/Lib/test/test_asyncio/test_sslproto.py index 39b19dd8594b1a..edb5cf709da849 100644 --- a/Lib/test/test_asyncio/test_sslproto.py +++ b/Lib/test/test_asyncio/test_sslproto.py @@ -429,6 +429,7 @@ def test_start_tls_server_1(self): server_context = test_utils.simple_server_sslcontext() client_context = test_utils.simple_client_sslcontext() + client_context.options |= ssl.OP_NO_TLSv1_3 def client(sock, addr): sock.settimeout(self.TIMEOUT) From 93e66f6a94b421b576c7958e48146a67f4c89a33 Mon Sep 17 00:00:00 2001 From: Pablo Galindo Salgado Date: Mon, 29 Oct 2018 11:24:38 -0400 Subject: [PATCH 2/3] Add a comment explaining the fix --- Lib/test/test_asyncio/test_sslproto.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Lib/test/test_asyncio/test_sslproto.py b/Lib/test/test_asyncio/test_sslproto.py index edb5cf709da849..add641f42e2baa 100644 --- a/Lib/test/test_asyncio/test_sslproto.py +++ b/Lib/test/test_asyncio/test_sslproto.py @@ -429,6 +429,10 @@ def test_start_tls_server_1(self): server_context = test_utils.simple_server_sslcontext() client_context = test_utils.simple_client_sslcontext() + # bpo-35031: Some FreeBSD buildbots fail to run this test + # as the eof was not being received by the server if the payload + # size is not big enough. This behaviour only appears if the + # client is using TLS1.3. client_context.options |= ssl.OP_NO_TLSv1_3 def client(sock, addr): From f777fa5f2bd16ac8d60416eaa64eb9d2cf84ffac Mon Sep 17 00:00:00 2001 From: Pablo Galindo Salgado Date: Mon, 29 Oct 2018 12:34:20 -0400 Subject: [PATCH 3/3] Opt out of TLS 1.3 only on FreeBSD --- Lib/test/test_asyncio/test_sslproto.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Lib/test/test_asyncio/test_sslproto.py b/Lib/test/test_asyncio/test_sslproto.py index add641f42e2baa..19b7a4366b2e82 100644 --- a/Lib/test/test_asyncio/test_sslproto.py +++ b/Lib/test/test_asyncio/test_sslproto.py @@ -2,6 +2,7 @@ import logging import socket +import sys import unittest from unittest import mock try: @@ -429,11 +430,12 @@ def test_start_tls_server_1(self): server_context = test_utils.simple_server_sslcontext() client_context = test_utils.simple_client_sslcontext() - # bpo-35031: Some FreeBSD buildbots fail to run this test - # as the eof was not being received by the server if the payload - # size is not big enough. This behaviour only appears if the - # client is using TLS1.3. - client_context.options |= ssl.OP_NO_TLSv1_3 + if sys.platform.startswith('freebsd'): + # bpo-35031: Some FreeBSD buildbots fail to run this test + # as the eof was not being received by the server if the payload + # size is not big enough. This behaviour only appears if the + # client is using TLS1.3. + client_context.options |= ssl.OP_NO_TLSv1_3 def client(sock, addr): sock.settimeout(self.TIMEOUT)