Skip to content

Commit

Permalink
bpo-25674: remove sha256.tbs-internet.com ssl test (python#3297)
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Heimes <[email protected]>
  • Loading branch information
tiran authored Sep 4, 2017
1 parent 0c7983e commit 002d640
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 156 deletions.
128 changes: 0 additions & 128 deletions Lib/test/sha256.pem

This file was deleted.

28 changes: 0 additions & 28 deletions Lib/test/test_ssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -1803,34 +1803,6 @@ def test_get_server_certificate_ipv6(self):
_test_get_server_certificate(self, 'ipv6.google.com', 443)
_test_get_server_certificate_fail(self, 'ipv6.google.com', 443)

def test_algorithms(self):
# Issue #8484: all algorithms should be available when verifying a
# certificate.
# SHA256 was added in OpenSSL 0.9.8
if ssl.OPENSSL_VERSION_INFO < (0, 9, 8, 0, 15):
self.skipTest("SHA256 not available on %r" % ssl.OPENSSL_VERSION)
# sha256.tbs-internet.com needs SNI to use the correct certificate
if not ssl.HAS_SNI:
self.skipTest("SNI needed for this test")
# https://sha2.hboeck.de/ was used until 2011-01-08 (no route to host)
remote = ("sha256.tbs-internet.com", 443)
sha256_cert = os.path.join(os.path.dirname(__file__), "sha256.pem")
with support.transient_internet("sha256.tbs-internet.com"):
ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
ctx.verify_mode = ssl.CERT_REQUIRED
ctx.load_verify_locations(sha256_cert)
s = ctx.wrap_socket(socket.socket(socket.AF_INET),
server_hostname="sha256.tbs-internet.com")
try:
s.connect(remote)
if support.verbose:
sys.stdout.write("\nCipher with %r is %r\n" %
(remote, s.cipher()))
sys.stdout.write("Certificate is:\n%s\n" %
pprint.pformat(s.getpeercert()))
finally:
s.close()


def _test_get_server_certificate(test, host, port, cert=None):
pem = ssl.get_server_certificate((host, port))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove sha256.tbs-internet.com ssl test

0 comments on commit 002d640

Please sign in to comment.