mirror of https://github.com/python/cpython
merge 3.4
This commit is contained in:
commit
3e2500d6db
|
@ -104,8 +104,6 @@ from _ssl import (
|
||||||
SSLSyscallError, SSLEOFError,
|
SSLSyscallError, SSLEOFError,
|
||||||
)
|
)
|
||||||
from _ssl import CERT_NONE, CERT_OPTIONAL, CERT_REQUIRED
|
from _ssl import CERT_NONE, CERT_OPTIONAL, CERT_REQUIRED
|
||||||
from _ssl import (VERIFY_DEFAULT, VERIFY_CRL_CHECK_LEAF, VERIFY_CRL_CHECK_CHAIN,
|
|
||||||
VERIFY_X509_STRICT)
|
|
||||||
from _ssl import txt2obj as _txt2obj, nid2obj as _nid2obj
|
from _ssl import txt2obj as _txt2obj, nid2obj as _nid2obj
|
||||||
from _ssl import RAND_status, RAND_add, RAND_bytes, RAND_pseudo_bytes
|
from _ssl import RAND_status, RAND_add, RAND_bytes, RAND_pseudo_bytes
|
||||||
try:
|
try:
|
||||||
|
@ -122,6 +120,7 @@ def _import_symbols(prefix):
|
||||||
_import_symbols('OP_')
|
_import_symbols('OP_')
|
||||||
_import_symbols('ALERT_DESCRIPTION_')
|
_import_symbols('ALERT_DESCRIPTION_')
|
||||||
_import_symbols('SSL_ERROR_')
|
_import_symbols('SSL_ERROR_')
|
||||||
|
_import_symbols('VERIFY_')
|
||||||
|
|
||||||
from _ssl import HAS_SNI, HAS_ECDH, HAS_NPN, HAS_ALPN
|
from _ssl import HAS_SNI, HAS_ECDH, HAS_NPN, HAS_ALPN
|
||||||
|
|
||||||
|
|
|
@ -2284,7 +2284,8 @@ else:
|
||||||
context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
|
context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
|
||||||
context.verify_mode = ssl.CERT_REQUIRED
|
context.verify_mode = ssl.CERT_REQUIRED
|
||||||
context.load_verify_locations(SIGNING_CA)
|
context.load_verify_locations(SIGNING_CA)
|
||||||
self.assertEqual(context.verify_flags, ssl.VERIFY_DEFAULT)
|
tf = getattr(ssl, "VERIFY_X509_TRUSTED_FIRST", 0)
|
||||||
|
self.assertEqual(context.verify_flags, ssl.VERIFY_DEFAULT | tf)
|
||||||
|
|
||||||
# VERIFY_DEFAULT should pass
|
# VERIFY_DEFAULT should pass
|
||||||
server = ThreadedEchoServer(context=server_context, chatty=True)
|
server = ThreadedEchoServer(context=server_context, chatty=True)
|
||||||
|
|
Loading…
Reference in New Issue