{"action":"opened","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/10294","labels_url":"https://api.github.com/repos/ansible/ansible/issues/10294/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/10294/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/10294/events","html_url":"https://github.com/ansible/ansible/issues/10294","id":58222456,"number":10294,"title":"Ansible Connect windows : WINRM CONNECTION ERROR: 500 WinRMTransport. [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)","user":{"login":"fsteinel","id":7137,"avatar_url":"https://avatars.githubusercontent.com/u/7137?v=3","gravatar_id":"","url":"https://api.github.com/users/fsteinel","html_url":"https://github.com/fsteinel","followers_url":"https://api.github.com/users/fsteinel/followers","following_url":"https://api.github.com/users/fsteinel/following{/other_user}","gists_url":"https://api.github.com/users/fsteinel/gists{/gist_id}","starred_url":"https://api.github.com/users/fsteinel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fsteinel/subscriptions","organizations_url":"https://api.github.com/users/fsteinel/orgs","repos_url":"https://api.github.com/users/fsteinel/repos","events_url":"https://api.github.com/users/fsteinel/events{/privacy}","received_events_url":"https://api.github.com/users/fsteinel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-02-19T15:26:31Z","updated_at":"2015-02-19T15:26:31Z","closed_at":null,"body":"Accessing a Win7 machine using the windows automatic default self signed cert requires [opting-out](https://www.python.org/dev/peps/pep-0476/#opting-out).\r\n\r\nError Message from pywinrm:\r\n- `WINRM CONNECTION ERROR: 500 WinRMTransport. [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)`\r\n\r\nThe quick and really dirty (see link) test was that I added (and removed) the line to urllib2.py.\r\n\r\nThe [pywinrm](https://github.com/diyan/pywinrm/pull/43) pull request might help to make that happen.\r\n\r\nenv:\r\n Ansible control: \r\n - Gentoo x64 Ansible1.8.2\r\n - pywinrm 0.0.3\r\n client: windows 7 Service Pack 1\r\n\r\nMy Steps:\r\n1. control\r\ncat /etc/ansible/hosts\r\n [win]\r\n 192.168.0.8\r\n cat /etc/ansible/group_vars/win2.yml \r\n ansible_ssh_user: Administrator\r\n ansible_ssh_pass: 3KRxuSezVdx5\r\n ansible_ssh_port: 5986\r\n ansible_connection: winrm\r\n\r\n2.then I run the scripts on windows server 2012 R2:\r\n upgrade_to_ps3.ps1\r\n ConfigureRemotingForAnsible.ps1\r\nhttps://github.com/ansible/ansible/blob/devel/examples/scripts/ConfigureRemotingForAnsible.ps1 \r\nread http://damonoverboe.org/post/ansible-and-windows-basic-set-up\r\n\r\n3.the question:\r\n```\r\nfsteinel@host:~# ansible win2 -m win_ping\r\n<192.168.0.8> ESTABLISH WINRM CONNECTION FOR USER: Administrator on PORT 5986 TO  192.168.0.8\r\n<192.168.0.8> WINRM CONNECT: transport=plaintext endpoint=https://192.168.0.8:5986/wsman\r\n<192.168.0.8> WINRM CONNECTION ERROR: 500 WinRMTransport. [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)\r\n<192.168.0.8> WINRM CONNECT: transport=plaintext endpoint=http://192.168.0.8:5986/wsman\r\n192.168.0.8 | FAILED => Traceback (most recent call last):\r\n  File \"/usr/lib64/python2.7/site-packages/ansible/runner/__init__.py\", line 590, in _executor\r\n    exec_rc = self._executor_internal(host, new_stdin)\r\n  File \"/usr/lib64/python2.7/site-packages/ansible/runner/__init__.py\", line 792, in _executor_internal\r\n    return self._executor_internal_inner(host, self.module_name, self.module_args, inject, port, complex_args=complex_args)\r\n  File \"/usr/lib64/python2.7/site-packages/ansible/runner/__init__.py\", line 955, in _executor_internal_inner\r\n    conn = self.connector.connect(actual_host, actual_port, actual_user, actual_pass, actual_transport, actual_private_key_file)\r\n  File \"/usr/lib64/python2.7/site-packages/ansible/runner/connection.py\", line 51, in connect\r\n    self.active = conn.connect()\r\n  File \"/usr/lib64/python2.7/site-packages/ansible/runner/connection_plugins/winrm.py\", line 132, in connect\r\n    self.protocol = self._winrm_connect()\r\n  File \"/usr/lib64/python2.7/site-packages/ansible/runner/connection_plugins/winrm.py\", line 86, in _winrm_connect\r\n    protocol.send_message('')\r\n  File \"/usr/lib64/python2.7/site-packages/winrm/protocol.py\", line 173, in send_message\r\n    return self.transport.send_message(message)\r\n  File \"/usr/lib64/python2.7/site-packages/winrm/transport.py\", line 76, in send_message\r\n    response = urlopen(request, timeout=self.timeout)\r\n  File \"/usr/lib64/python2.7/urllib2.py\", line 154, in urlopen\r\n    return opener.open(url, data, timeout)\r\n  File \"/usr/lib64/python2.7/urllib2.py\", line 431, in open\r\n    response = self._open(req, data)\r\n  File \"/usr/lib64/python2.7/urllib2.py\", line 449, in _open\r\n    '_open', req)\r\n  File \"/usr/lib64/python2.7/urllib2.py\", line 409, in _call_chain\r\n    result = func(*args)\r\n  File \"/usr/lib64/python2.7/urllib2.py\", line 1227, in http_open\r\n    return self.do_open(httplib.HTTPConnection, req)\r\n  File \"/usr/lib64/python2.7/urllib2.py\", line 1200, in do_open\r\n    r = h.getresponse(buffering=True)\r\n  File \"/usr/lib64/python2.7/httplib.py\", line 1073, in getresponse\r\n    response.begin()\r\n  File \"/usr/lib64/python2.7/httplib.py\", line 415, in begin\r\n    version, status, reason = self._read_status()\r\n  File \"/usr/lib64/python2.7/httplib.py\", line 371, in _read_status\r\n    line = self.fp.readline(_MAXLINE + 1)\r\n  File \"/usr/lib64/python2.7/socket.py\", line 476, in readline\r\n    data = self._sock.recv(self._rbufsize)\r\nerror: [Errno 104] Connection reset by peer\r\n```\r\n"}}