File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
templates/federated_reporting Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -69,13 +69,15 @@ def __init__(
6969 basic_auth = "{}:{}" .format (self ._api_user , self ._api_password )
7070 )
7171 self ._headers ["Content-Type" ] = "application/json"
72- # In order to avoid SubjectAltNameWarning with our self-signed certs, silence it
73- if not sys .warnoptions :
74- import warnings
75-
76- warnings .simplefilter (
77- "ignore" , category = urllib3 .exceptions .SubjectAltNameWarning
78- )
72+ # urllib3 v2.0 removed SubjectAltNameWarning and instead throws an error if no SubjectAltName is present in a certificate
73+ if hasattr (urllib3 .exceptions , "SubjectAltNameWarning" ):
74+ # if urllib3 is < v2.0 then SubjectAltNameWarning will exist and should be silenced
75+ if not sys .warnoptions :
76+ import warnings
77+
78+ warnings .simplefilter (
79+ "ignore" , category = urllib3 .exceptions .SubjectAltNameWarning
80+ )
7981
8082 def __str__ (self ):
8183 return str (self .__class__ ) + ":" + str (self .__dict__ )
You can’t perform that action at this time.
0 commit comments