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
78644cf0
Commit
78644cf0
authored
May 26, 2016
by
Steve Dower
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #27114: Fix SSLContext._load_windows_store_certs fails with PermissionError
parent
6427cf4b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
+12
-5
Lib/ssl.py
Lib/ssl.py
+9
-5
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/ssl.py
View file @
78644cf0
...
...
@@ -145,6 +145,7 @@ from socket import socket, AF_INET, SOCK_STREAM, create_connection
from
socket
import
SOL_SOCKET
,
SO_TYPE
import
base64
# for DER-to-PEM translation
import
errno
import
warnings
socket_error
=
OSError
# keep that public name in module namespace
...
...
@@ -405,11 +406,14 @@ class SSLContext(_SSLContext):
def _load_windows_store_certs(self, storename, purpose):
certs = bytearray()
for cert, encoding, trust in enum_certificates(storename):
# CA certs are never PKCS#7 encoded
if encoding == "x509_asn":
if trust is True or purpose.oid in trust:
certs.extend(cert)
try:
for cert, encoding, trust in enum_certificates(storename):
# CA certs are never PKCS#7 encoded
if encoding == "x509_asn":
if trust is True or purpose.oid in trust:
certs.extend(cert)
except PermissionError:
warnings.warn("unable to enumerate Windows certificate store")
if certs:
self.load_verify_locations(cadata=certs)
return certs
...
...
Misc/NEWS
View file @
78644cf0
...
...
@@ -126,6 +126,9 @@ Core and Builtins
Library
-------
- Issue #27114: Fix SSLContext._load_windows_store_certs fails with
PermissionError
- Issue #18383: Avoid creating duplicate filters when using filterwarnings
and simplefilter. Based on patch by Alex Shkop.
...
...
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