# Issues Using Ansible with ServiceNow Through an HTTP Proxy

**URL:** <https://forum.ansible.com/t/issues-using-ansible-with-servicenow-through-an-http-proxy/34279>\
**Category:** Ansible Project\
**Created:** [December 3, 2020, 10:26pm UTC](https://forum.ansible.com/t/issues-using-ansible-with-servicenow-through-an-http-proxy/34279 "2020-12-03T22:26:07Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Steven\_Klinder](https://avatars.discourse-cdn.com/v4/letter/s/dec6dc/32.png) [@Steven\_Klinder](https://forum.ansible.com/u/Steven_Klinder)\
**Post date:** [December 3, 2020, 10:26pm UTC](https://forum.ansible.com/t/issues-using-ansible-with-servicenow-through-an-http-proxy/34279/1 "2020-12-03T22:26:07Z")

</div>

I am trying to allow my Ansible controller to connect to my ServiceNow instance through an HTTP proxy using the “snow\_record” and “snow\_record\_find” modules. I am running Ansible v2.9.10 with the Python “pysnow” v0.7.16 package and am unable to find a work around for the following SSL verification error:

---

<div class="post-metadata">

**Author:** ![Ankit2](https://avatars.discourse-cdn.com/v4/letter/a/ea5d25/32.png) [@Ankit2](https://forum.ansible.com/u/Ankit2)\
**Post date:** [December 7, 2020, 1:24pm UTC](https://forum.ansible.com/t/issues-using-ansible-with-servicenow-through-an-http-proxy/34279/2 "2020-12-07T13:24:58Z")

</div>

Are you using something like ADFS or you can connect to Servicenow directly using servicenow URL?

---

<div class="post-metadata">

**Author:** ![Shashikumar\_V](https://avatars.discourse-cdn.com/v4/letter/s/edb3f5/32.png) [@Shashikumar\_V](https://forum.ansible.com/u/Shashikumar_V)\
**Post date:** [December 7, 2020, 1:57pm UTC](https://forum.ansible.com/t/issues-using-ansible-with-servicenow-through-an-http-proxy/34279/3 "2020-12-07T13:57:01Z")

</div>

Please port 5985 and ansbile\_scheme\_conntion= http

---

<div class="post-metadata">

**Author:** ![Steven\_Klinder](https://avatars.discourse-cdn.com/v4/letter/s/dec6dc/32.png) [@Steven\_Klinder](https://forum.ansible.com/u/Steven_Klinder)\
**Post date:** [December 11, 2020, 12:55am UTC](https://forum.ansible.com/t/issues-using-ansible-with-servicenow-through-an-http-proxy/34279/4 "2020-12-11T00:55:04Z")

</div>

Hi @Ankit. I am not using ADFS. I am successfully able to authenticate to ServiceNow when using the URI module or browsing to it using a browser.

---

<div class="post-metadata">

**Author:** ![Steven\_Klinder](https://avatars.discourse-cdn.com/v4/letter/s/dec6dc/32.png) [@Steven\_Klinder](https://forum.ansible.com/u/Steven_Klinder)\
**Post date:** [December 11, 2020, 12:58am UTC](https://forum.ansible.com/t/issues-using-ansible-with-servicenow-through-an-http-proxy/34279/5 "2020-12-11T00:58:07Z")

</div>

Port 5985 is related to WinRM. I’m not sure I understand what you’re recommending. Any additional details you can provide would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![jason\_rossi](https://avatars.discourse-cdn.com/v4/letter/j/90ced4/32.png) [@jason\_rossi](https://forum.ansible.com/u/jason_rossi)\
**Post date:** [December 11, 2020, 3:09pm UTC](https://forum.ansible.com/t/issues-using-ansible-with-servicenow-through-an-http-proxy/34279/6 "2020-12-11T15:09:29Z")

</div>

I thought the same thing I think he is referring to ([https://docs.ansible.com/ansible/latest/user\_guide/windows\_winrm.html](https://docs.ansible.com/ansible/latest/user_guide/windows_winrm.html))

Not sure how that helps here.

I am far from an expert on this:  
But what I usually do is shell to that machine using the “ansible user account” and ensure things are setup to allow that communication to occur…

ie setup:

export {HTTP,HTTPS}\_PROXY=[http://a:a@x.x.x.x:3128/](http://a:a@x.x.x.x:3128/)  
export {http,https}\_proxy=[http://a:a@x.x.x.x:3128/](http://a:a@x.x.x.x:3128/)

echo “export {HTTP,HTTPS}\_PROXY=[http://a:a@x.x.x.x:3128/](http://a:a@x.x.x.x:3128/)” \> /etc/profile.d/http\_proxy.sh  
echo “export {http,https}\_proxy=[http://a:a@x.x.x.x:3128/](http://a:a@x.x.x.x:3128/)” \> /etc/profile.d/http\_proxy.sh

Then when I get that working in that account context then I retry the playbook. But the python code itself needs to use it… so its a matter of if the code takes those environmental variables into effect or not.

There clearly are ansible ways to set above. Just thought I would chime in becasue I feel your pain.

---

<div class="post-metadata">

**Author:** ![Jagadish\_Raj](https://avatars.discourse-cdn.com/v4/letter/j/a5b964/32.png) [@Jagadish\_Raj](https://forum.ansible.com/u/Jagadish_Raj)\
**Post date:** [March 31, 2021, 10:25am UTC](https://forum.ansible.com/t/issues-using-ansible-with-servicenow-through-an-http-proxy/34279/7 "2021-03-31T10:25:47Z")

</div>

Hi Steven,  
I see the same issue when connecting to ServiceNow. By any chance, were you able to fix this issue?

Thanks,  
Jagadish
