diff --git a/.evergreen/scripts/setup-system.sh b/.evergreen/scripts/setup-system.sh index d8552e0ad2..9158414cce 100755 --- a/.evergreen/scripts/setup-system.sh +++ b/.evergreen/scripts/setup-system.sh @@ -38,4 +38,14 @@ if [ "$(uname -s)" = "Darwin" ]; then fi fi +if [ -w /etc/hosts ]; then + SUDO="" +else + SUDO="sudo" +fi + +# Add 'server' and 'hostname_not_in_cert' as a hostnames +echo "127.0.0.1 server" | $SUDO tee -a /etc/hosts +echo "127.0.0.1 hostname_not_in_cert" | $SUDO tee -a /etc/hosts + echo "Setting up system... done." diff --git a/test/asynchronous/test_ssl.py b/test/asynchronous/test_ssl.py index a05bc9379d..0ce3e8bbac 100644 --- a/test/asynchronous/test_ssl.py +++ b/test/asynchronous/test_ssl.py @@ -304,8 +304,13 @@ async def test_cert_ssl_uri_support(self): client = self.simple_client(uri_fmt % (CLIENT_PEM, "true", CA_PEM)) await self.assertClientWorks(client) + @unittest.skipIf( + "PyPy" in sys.version and not _IS_SYNC, + "https://github.com/pypy/pypy/issues/5131 flaky on async PyPy due to SSL EOF", + ) @async_client_context.require_tlsCertificateKeyFile @async_client_context.require_server_resolvable + @async_client_context.require_no_api_version @ignore_deprecations async def test_cert_ssl_validation_hostname_matching(self): # Expects the server to be running with server.pem and ca.pem @@ -430,8 +435,13 @@ async def test_tlsCRLFile_support(self): self.simple_client(uri_fmt % (CRL_PEM, CA_PEM), **self.credentials) # type: ignore[arg-type] ) + @unittest.skipIf( + "PyPy" in sys.version and not _IS_SYNC, + "https://github.com/pypy/pypy/issues/5131 flaky on async PyPy due to SSL EOF", + ) @async_client_context.require_tlsCertificateKeyFile @async_client_context.require_server_resolvable + @async_client_context.require_no_api_version @ignore_deprecations async def test_validation_with_system_ca_certs(self): # Expects the server to be running with server.pem and ca.pem. diff --git a/test/test_ssl.py b/test/test_ssl.py index 3ac0a4555a..b1e9a65eb5 100644 --- a/test/test_ssl.py +++ b/test/test_ssl.py @@ -304,8 +304,13 @@ def test_cert_ssl_uri_support(self): client = self.simple_client(uri_fmt % (CLIENT_PEM, "true", CA_PEM)) self.assertClientWorks(client) + @unittest.skipIf( + "PyPy" in sys.version and not _IS_SYNC, + "https://github.com/pypy/pypy/issues/5131 flaky on async PyPy due to SSL EOF", + ) @client_context.require_tlsCertificateKeyFile @client_context.require_server_resolvable + @client_context.require_no_api_version @ignore_deprecations def test_cert_ssl_validation_hostname_matching(self): # Expects the server to be running with server.pem and ca.pem @@ -430,8 +435,13 @@ def test_tlsCRLFile_support(self): self.simple_client(uri_fmt % (CRL_PEM, CA_PEM), **self.credentials) # type: ignore[arg-type] ) + @unittest.skipIf( + "PyPy" in sys.version and not _IS_SYNC, + "https://github.com/pypy/pypy/issues/5131 flaky on async PyPy due to SSL EOF", + ) @client_context.require_tlsCertificateKeyFile @client_context.require_server_resolvable + @client_context.require_no_api_version @ignore_deprecations def test_validation_with_system_ca_certs(self): # Expects the server to be running with server.pem and ca.pem.