Skip to content

Commit 4bc8ef0

Browse files
authored
[3.6] bpo-25674: remove sha256.tbs-internet.com ssl test (GH-3297) (#3300)
Signed-off-by: Christian Heimes <[email protected]> (cherry picked from commit 002d640)
1 parent 6a116c2 commit 4bc8ef0

File tree

3 files changed

+1
-156
lines changed

3 files changed

+1
-156
lines changed

Lib/test/sha256.pem

Lines changed: 0 additions & 128 deletions
This file was deleted.

Lib/test/test_ssl.py

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1793,34 +1793,6 @@ def test_get_server_certificate_ipv6(self):
17931793
_test_get_server_certificate(self, 'ipv6.google.com', 443)
17941794
_test_get_server_certificate_fail(self, 'ipv6.google.com', 443)
17951795

1796-
def test_algorithms(self):
1797-
# Issue #8484: all algorithms should be available when verifying a
1798-
# certificate.
1799-
# SHA256 was added in OpenSSL 0.9.8
1800-
if ssl.OPENSSL_VERSION_INFO < (0, 9, 8, 0, 15):
1801-
self.skipTest("SHA256 not available on %r" % ssl.OPENSSL_VERSION)
1802-
# sha256.tbs-internet.com needs SNI to use the correct certificate
1803-
if not ssl.HAS_SNI:
1804-
self.skipTest("SNI needed for this test")
1805-
# https://sha2.hboeck.de/ was used until 2011-01-08 (no route to host)
1806-
remote = ("sha256.tbs-internet.com", 443)
1807-
sha256_cert = os.path.join(os.path.dirname(__file__), "sha256.pem")
1808-
with support.transient_internet("sha256.tbs-internet.com"):
1809-
ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
1810-
ctx.verify_mode = ssl.CERT_REQUIRED
1811-
ctx.load_verify_locations(sha256_cert)
1812-
s = ctx.wrap_socket(socket.socket(socket.AF_INET),
1813-
server_hostname="sha256.tbs-internet.com")
1814-
try:
1815-
s.connect(remote)
1816-
if support.verbose:
1817-
sys.stdout.write("\nCipher with %r is %r\n" %
1818-
(remote, s.cipher()))
1819-
sys.stdout.write("Certificate is:\n%s\n" %
1820-
pprint.pformat(s.getpeercert()))
1821-
finally:
1822-
s.close()
1823-
18241796

18251797
def _test_get_server_certificate(test, host, port, cert=None):
18261798
pem = ssl.get_server_certificate((host, port))
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Remove sha256.tbs-internet.com ssl test

0 commit comments

Comments
 (0)