# Failed to connect to a Windows server using Ansible

**URL:** <https://forum.ansible.com/t/failed-to-connect-to-a-windows-server-using-ansible/38722>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [March 19, 2024, 9:12pm UTC](https://forum.ansible.com/t/failed-to-connect-to-a-windows-server-using-ansible/38722 "2024-03-19T21:12:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![denilson\_hernandez\_s](https://avatars.discourse-cdn.com/v4/letter/d/43a26b/32.png) [@denilson\_hernandez\_s](https://forum.ansible.com/u/denilson_hernandez_s)\
**Post date:** [March 19, 2024, 9:12pm UTC](https://forum.ansible.com/t/failed-to-connect-to-a-windows-server-using-ansible/38722/1 "2024-03-19T21:12:30Z")

</div>

Hello community.

I hope you are doing well.

I’m using Ansible to automate tasks from my windows servers, but it’s giving me an error like this. Does anyone know how I can fix it?

fatal: [xxxxxxx]: UNREACHABLE! =\> {  
“changed”: false,  
“msg”: “basic: HTTPSConnectionPool(host=‘xxxxxx’, port=5986): Max retries exceeded with url: /wsman (Caused by SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE\_VERIFY\_FAILED] certificate verify failed: unable to get local issuer certificate (\_ssl.c:1007)’)))”,  
“unreachable”: true  
}

---

<div class="post-metadata">

**Author:** ![Stu](https://avatars.discourse-cdn.com/v4/letter/s/3ec8ea/32.png) [@Stu](https://forum.ansible.com/u/Stu)\
**Post date:** [March 20, 2024, 11:34am UTC](https://forum.ansible.com/t/failed-to-connect-to-a-windows-server-using-ansible/38722/2 "2024-03-20T11:34:08Z")

</div>

Looks like it’s failing to verify the certificate to create a secure connection.

Assuming it’s a self signed cert you’ll need to ensure it’s trusted from your control host.

could always disable cert verification but wouldn’t recommend it.

Stu

---

<div class="post-metadata">

**Author:** ![denilson\_hernandez\_s](https://avatars.discourse-cdn.com/v4/letter/d/43a26b/32.png) [@denilson\_hernandez\_s](https://forum.ansible.com/u/denilson_hernandez_s)\
**Post date:** [June 14, 2024, 8:30pm UTC](https://forum.ansible.com/t/failed-to-connect-to-a-windows-server-using-ansible/38722/3 "2024-06-14T20:30:45Z")

</div>

I already did,

Even in the parameterization I indicate it to use HTTPS.

I attach an image of how I have ansible

ansible\_user: “{{ansible\_user}}”  
ansible\_password: “{{ansible\_password}}”  
ansible\_connection: “winrm”  
ansible\_port: 5986  
ansible\_winrm\_scheme: https  
ansible\_winrm\_server\_cert\_validation: ignore  
ansible\_winrm\_transport: ntlm  
ansible\_python\_interpreter: /usr/bin/python3
