Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(157088)

Side by Side Diff: Lib/test/test_ssl.py

Issue 15740: test_ssl failure when cacert.org CA cert in system keychain on OSX
Patch Set: Created 6 years, 11 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Test the support for SSL and sockets 1 # Test the support for SSL and sockets
2 2
3 import sys 3 import sys
4 import unittest 4 import unittest
5 from test import support 5 from test import support
6 import socket 6 import socket
7 import select 7 import select
8 import time 8 import time
9 import gc 9 import gc
10 import os 10 import os
11 import errno 11 import errno
12 import pprint 12 import pprint
13 import tempfile 13 import tempfile
14 import urllib.request 14 import urllib.request
15 import traceback 15 import traceback
16 import asyncore 16 import asyncore
17 import weakref 17 import weakref
18 import platform 18 import platform
19 import functools 19 import functools
20
21 if sys.platform == 'darwin':
22 # Apple's installation of OpenSSL in /usr/lib is patched to
23 # integrate with Apple's KeyChain. OpenSSL will verify certificates
24 # using the CA roots that are part of the system and user keychains,
25 # unless that code is disabled using an environment variable.
26 #
27 # The environment variable below disables the keychain integration,
28 # and avoids test failures when the CAcert root certificate (the signer
29 # of the certificate for svn.python.org) happens to be in the keychain of
30 # a system where the tests are run.
31 #
32 # Note: this cannot be done in a setUp method for NetworkedTests because
33 # the presence of the environment variable is cached by OpenSSL, and some
34 # other test might trigger the check for the environment variable before
35 # NetworkedTests is run.
36 os.putenv("OPENSSL_X509_TEA_DISABLE", "1")
37
20 38
21 ssl = support.import_module("ssl") 39 ssl = support.import_module("ssl")
22 40
23 PROTOCOLS = [ 41 PROTOCOLS = [
24 ssl.PROTOCOL_SSLv3, 42 ssl.PROTOCOL_SSLv3,
25 ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_TLSv1 43 ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_TLSv1
26 ] 44 ]
27 if hasattr(ssl, 'PROTOCOL_SSLv2'): 45 if hasattr(ssl, 'PROTOCOL_SSLv2'):
28 PROTOCOLS.append(ssl.PROTOCOL_SSLv2) 46 PROTOCOLS.append(ssl.PROTOCOL_SSLv2)
29 47
(...skipping 1953 matching lines...) Expand 10 before | Expand all | Expand 10 after
1983 tests.append(ThreadedTests) 2001 tests.append(ThreadedTests)
1984 2002
1985 try: 2003 try:
1986 support.run_unittest(*tests) 2004 support.run_unittest(*tests)
1987 finally: 2005 finally:
1988 if _have_threads: 2006 if _have_threads:
1989 support.threading_cleanup(*thread_info) 2007 support.threading_cleanup(*thread_info)
1990 2008
1991 if __name__ == "__main__": 2009 if __name__ == "__main__":
1992 test_main() 2010 test_main()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+