File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -145,6 +145,7 @@ def _import_symbols(prefix):
145145from socket import SOL_SOCKET , SO_TYPE
146146import base64 # for DER-to-PEM translation
147147import errno
148+ import warnings
148149
149150
150151socket_error = OSError # keep that public name in module namespace
@@ -405,11 +406,14 @@ def set_alpn_protocols(self, alpn_protocols):
405406
406407 def _load_windows_store_certs (self , storename , purpose ):
407408 certs = bytearray ()
408- for cert , encoding , trust in enum_certificates (storename ):
409- # CA certs are never PKCS#7 encoded
410- if encoding == "x509_asn" :
411- if trust is True or purpose .oid in trust :
412- certs .extend (cert )
409+ try :
410+ for cert , encoding , trust in enum_certificates (storename ):
411+ # CA certs are never PKCS#7 encoded
412+ if encoding == "x509_asn" :
413+ if trust is True or purpose .oid in trust :
414+ certs .extend (cert )
415+ except PermissionError :
416+ warnings .warn ("unable to enumerate Windows certificate store" )
413417 if certs :
414418 self .load_verify_locations (cadata = certs )
415419 return certs
Original file line number Diff line number Diff line change @@ -126,6 +126,9 @@ Core and Builtins
126126Library
127127-------
128128
129+ - Issue #27114: Fix SSLContext._load_windows_store_certs fails with
130+ PermissionError
131+
129132- Issue #18383: Avoid creating duplicate filters when using filterwarnings
130133 and simplefilter. Based on patch by Alex Shkop.
131134
You can’t perform that action at this time.
0 commit comments