diff --git a/changelogs/fragments/urls-proxy-validate.yaml b/changelogs/fragments/urls-proxy-validate.yaml new file mode 100644 index 00000000000..65f4aa6668d --- /dev/null +++ b/changelogs/fragments/urls-proxy-validate.yaml @@ -0,0 +1,2 @@ +bugfixes: +- 'urls - When validating SSL certs using an a non-SSL proxy, do not send "Connection: close" when requesting a tunnel. This prevents some proxy servers from dropping the connection (https://github.com/ansible/ansible/issues/32750)' diff --git a/lib/ansible/module_utils/urls.py b/lib/ansible/module_utils/urls.py index cc75918d343..fd4130653bb 100644 --- a/lib/ansible/module_utils/urls.py +++ b/lib/ansible/module_utils/urls.py @@ -663,7 +663,7 @@ class SSLValidationHandler(urllib_request.BaseHandler): http://stackoverflow.com/questions/1087227/validate-ssl-certificates-with-python http://techknack.net/python-urllib2-handlers/ ''' - CONNECT_COMMAND = "CONNECT %s:%s HTTP/1.0\r\nConnection: close\r\n" + CONNECT_COMMAND = "CONNECT %s:%s HTTP/1.0\r\n" def __init__(self, hostname, port): self.hostname = hostname