Hi,

I am running Ansible 2.7.6 on Debian testing/sid and regularly run a 
playbook against Windows 7 desktops. However, I can not connect anymore and 
receive the following error (see below for a more verbose output):
ntlm: HTTPSConnectionPool(host='my-host', port=5986): Max retries exceeded 
with url: /wsman (Caused by SSLError(SSLError(1, '[SSL: 
UNSUPPORTED_PROTOCOL] unsupported protocol (_ssl.c:1056)')))

I have been able to do a WinRM connection from another Windows computer to 
the same target (as explained somewhere in Ansible documentation), so the 
target is probably OK. I did not find any similar issue on this forum, nor 
Ansible bug tracker, nor pywinrm bug tracker.

I know that debian recently moved to python3 for Ansible, and it seems that 
pywinrm has many issues whith python3 (see for example 
https://github.com/diyan/pywinrm/pull/222). Are there other people running 
Ansible with python3 against Windows host using self-signed certificates 
and NTLM ? Do you have any idea to help debugging this ?

Best regards,
Yvan


The more verbose output:


TASK [Gathering Facts] 
***************************************************************************************************************************************************************************
task path: /home/yvan/Nextcloud/Lycee/Ansible/windows-desktops.yml:1
Using module file /usr/lib/python3/dist-packages/ansible/modules/windows/
setup.ps1
<some-host> ESTABLISH WINRM CONNECTION FOR USER: .\administrateur on PORT 
5986 TO my-host
checking if winrm_host my-host is an IPv6 address
<my-host> WINRM CONNECT: transport=ntlm endpoint=https://my-host:5986/wsman
<my-host> WINRM CONNECTION ERROR: HTTPSConnectionPool(host='my-host', port=
5986): Max retries exceeded with url: /wsman (Caused by 
SSLError(SSLError(1, '[SSL: UNSUPPORTED_PROTOCOL] unsupported protocol 
(_ssl.c:1056)')))
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 
600, in urlopen
    chunked=chunked)
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 
343, in _make_request
    self._validate_conn(conn)
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 
841, in _validate_conn
    conn.connect()
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 344, in 
connect
    ssl_context=context)
  File "/usr/lib/python3/dist-packages/urllib3/util/ssl_.py", line 342, in 
ssl_wrap_socket
    return context.wrap_socket(sock, server_hostname=server_hostname)
  File "/usr/lib/python3.7/ssl.py", line 412, in wrap_socket
    session=session
  File "/usr/lib/python3.7/ssl.py", line 853, in _create
    self.do_handshake()
  File "/usr/lib/python3.7/ssl.py", line 1117, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL: UNSUPPORTED_PROTOCOL] unsupported protocol (_ssl.c:1056)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/requests/adapters.py", line 449, in 
send
    timeout=timeout
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 
638, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 398, in 
increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='my-host', 
port=5986): Max retries exceeded with url: /wsman (Caused by 
SSLError(SSLError(1, '[SSL: UNSUPPORTED_PROTOCOL] unsupported protocol 
(_ssl.c:1056)')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/ansible/plugins/connection/winrm.py", 
line 400, in _winrm_connect
    self.shell_id = protocol.open_shell(codepage=65001)  # UTF-8
  File "/usr/lib/python3/dist-packages/winrm/protocol.py", line 157, in 
open_shell
    res = self.send_message(xmltodict.unparse(req))
  File "/usr/lib/python3/dist-packages/winrm/protocol.py", line 234, in 
send_message
    resp = self.transport.send_message(message)
  File "/usr/lib/python3/dist-packages/winrm/transport.py", line 265, in 
send_message
    response = self._send_message_request(prepared_request, message)
  File "/usr/lib/python3/dist-packages/winrm/transport.py", line 270, in 
_send_message_request
    response = self.session.send(prepared_request, 
timeout=self.read_timeout_sec)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 637, in 
send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/adapters.py", line 514, in 
send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='my-host', 
port=5986): Max retries exceeded with url: /wsman (Caused by 
SSLError(SSLError(1, '[SSL: UNSUPPORTED_PROTOCOL] unsupported protocol 
(_ssl.c:1056)')))

fatal: [my-host]: UNREACHABLE! => {
    "changed": false,
    "msg": "ntlm: HTTPSConnectionPool(host='my-host', port=5986): Max 
retries exceeded with url: /wsman (Caused by SSLError(SSLError(1, '[SSL: 
UNSUPPORTED_PROTOCOL] unsupported protocol (_ssl.c:1056)')))",
    "unreachable": true
}


-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/9161e133-14ea-4a6c-a3a3-1b476f4a606a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to