|
|
|
@ -68,6 +68,7 @@ except ImportError:
|
|
|
|
|
# Python 3
|
|
|
|
|
import http.client as httplib # type: ignore[no-redef]
|
|
|
|
|
|
|
|
|
|
import ansible.module_utils.compat.typing as t
|
|
|
|
|
import ansible.module_utils.six.moves.http_cookiejar as cookiejar
|
|
|
|
|
import ansible.module_utils.six.moves.urllib.error as urllib_error
|
|
|
|
|
|
|
|
|
@ -86,7 +87,7 @@ except ImportError:
|
|
|
|
|
import urllib2 as urllib_request # type: ignore[no-redef]
|
|
|
|
|
from urllib2 import AbstractHTTPHandler, BaseHandler # type: ignore[no-redef]
|
|
|
|
|
|
|
|
|
|
urllib_request.HTTPRedirectHandler.http_error_308 = urllib_request.HTTPRedirectHandler.http_error_307
|
|
|
|
|
urllib_request.HTTPRedirectHandler.http_error_308 = urllib_request.HTTPRedirectHandler.http_error_307 # type: ignore[attr-defined]
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
from ansible.module_utils.six.moves.urllib.parse import urlparse, urlunparse, unquote
|
|
|
|
@ -160,7 +161,7 @@ if not HAS_SSLCONTEXT and HAS_SSL:
|
|
|
|
|
# The bundled backports.ssl_match_hostname should really be moved into its own file for processing
|
|
|
|
|
_BUNDLED_METADATA = {"pypi_name": "backports.ssl_match_hostname", "version": "3.7.0.1"}
|
|
|
|
|
|
|
|
|
|
LOADED_VERIFY_LOCATIONS = set()
|
|
|
|
|
LOADED_VERIFY_LOCATIONS = set() # type: t.Set[str]
|
|
|
|
|
|
|
|
|
|
HAS_MATCH_HOSTNAME = True
|
|
|
|
|
try:
|
|
|
|
|