Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
8b9cfa10
Commit
8b9cfa10
authored
Oct 03, 2014
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Plain Diff
merge 3.4 (#22449)
parents
df75fee9
5915b0f9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
2 deletions
+12
-2
Lib/ssl.py
Lib/ssl.py
+1
-2
Lib/test/test_ssl.py
Lib/test/test_ssl.py
+8
-0
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/ssl.py
View file @
8b9cfa10
...
...
@@ -379,8 +379,7 @@ class SSLContext(_SSLContext):
if sys.platform == "win32":
for storename in self._windows_cert_stores:
self._load_windows_store_certs(storename, purpose)
else:
self.set_default_verify_paths()
self.set_default_verify_paths()
def create_default_context(purpose=Purpose.SERVER_AUTH, *, cafile=None,
...
...
Lib/test/test_ssl.py
View file @
8b9cfa10
...
...
@@ -1095,6 +1095,14 @@ class ContextTests(unittest.TestCase):
self
.
assertRaises
(
TypeError
,
ctx
.
load_default_certs
,
None
)
self
.
assertRaises
(
TypeError
,
ctx
.
load_default_certs
,
'SERVER_AUTH'
)
def
test_load_default_certs_env
(
self
):
ctx
=
ssl
.
SSLContext
(
ssl
.
PROTOCOL_TLSv1
)
with
support
.
EnvironmentVarGuard
()
as
env
:
env
[
"SSL_CERT_DIR"
]
=
CAPATH
env
[
"SSL_CERT_FILE"
]
=
CERTFILE
ctx
.
load_default_certs
()
self
.
assertEqual
(
ctx
.
cert_store_stats
(),
{
"crl"
:
0
,
"x509"
:
1
,
"x509_ca"
:
0
})
def
test_create_default_context
(
self
):
ctx
=
ssl
.
create_default_context
()
self
.
assertEqual
(
ctx
.
protocol
,
ssl
.
PROTOCOL_SSLv23
)
...
...
Misc/NEWS
View file @
8b9cfa10
...
...
@@ -159,6 +159,9 @@ Core and Builtins
Library
-------
-
Issue
#
22449
:
In
the
ssl
.
SSLContext
.
load_default_certs
,
consult
the
enviromental
variables
SSL_CERT_DIR
and
SSL_CERT_FILE
on
Windows
.
-
Issue
#
22508
:
The
email
.
__version__
variable
has
been
removed
;
the
email
code
is
no
longer
shipped
separately
from
the
stdlib
,
and
__version__
hasn
't been updated in several releases.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment