# HTTP: Disabled while configuring WinRM service

**URL:** <https://forum.ansible.com/t/http-disabled-while-configuring-winrm-service/21795>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [June 16, 2016, 7:18pm UTC](https://forum.ansible.com/t/http-disabled-while-configuring-winrm-service/21795 "2016-06-16T19:18:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jonathan\_Anderson](https://avatars.discourse-cdn.com/v4/letter/j/45deac/32.png) [@Jonathan\_Anderson](https://forum.ansible.com/u/Jonathan_Anderson)\
**Post date:** [June 16, 2016, 7:18pm UTC](https://forum.ansible.com/t/http-disabled-while-configuring-winrm-service/21795/1 "2016-06-16T19:18:27Z")

</div>

Control Node:

- CentOS 7

- Ansible 2.1

- pywinrm version from May 19th, 2016

Remote Node:

- Windows 7

- Powershell 3  
When I run [Trond Hindenes powershell script](https://github.com/ansible/ansible/blob/devel/examples/scripts/ConfigureRemotingForAnsible.ps1) for setting up my windows remote node to connect with ansible I get the following output.

**VERBOSE: Verifying WinRM service.**  
**VERBOSE: Starting WinRM service.**  
**VERBOSE: PS Remoting is already enabled.**  
**VERBOSE: SSL listener is already active.**  
**VERBOSE: Basic auth is already enabled.**  
**VERBOSE: Firewall rule already exists to allow WinRM HTTPS.**  
**VERBOSE: HTTP: Enabled | HTTPS: Disabled**  
**VERBOSE: PS Remoting has been successfully configured for Ansible.**

Why would HTTPS be disabled and how do I enable it?

Here are my winrm service settings.

PS C:\Users\ads-6999\> winrm get winrm/config/service  
Service  
RootSDDL = O:NSG:BAD:P(A;;GA;;;BA)(A;;GR;;;IU)S:P(AU;FA;GA;;;WD)(AU;SA;GXGW;;;WD)  
MaxConcurrentOperations = 4294967295  
MaxConcurrentOperationsPerUser = 1500  
EnumerationTimeoutms = 240000  
MaxConnections = 300  
MaxPacketRetrievalTimeSeconds = 120  
AllowUnencrypted = false  
Auth  
Basic = true  
Kerberos = true  
Negotiate = true  
Certificate = true  
CredSSP = false  
CbtHardeningLevel = Relaxed  
DefaultPorts  
HTTP = 5985  
HTTPS = 5986  
IPv4Filter = \*  
IPv6Filter = \*  
EnableCompatibilityHttpListener = false  
EnableCompatibilityHttpsListener = false  
CertificateThumbprint  
AllowRemoteAccess = true

---

<div class="post-metadata">

**Author:** ![Trond\_Hindenes](https://avatars.discourse-cdn.com/v4/letter/t/96bed5/32.png) [@Trond\_Hindenes](https://forum.ansible.com/u/Trond_Hindenes)\
**Post date:** [June 16, 2016, 8:06pm UTC](https://forum.ansible.com/t/http-disabled-while-configuring-winrm-service/21795/2 "2016-06-16T20:06:14Z")

</div>

The “HTTPS Disabled” check was not written by me, that’s been added later. It might not mean much, as it tests without explicit credentials.

The ultimate test is (still) to perform the following from another machine:

$httpsOptions = New-PSSessionOption -SkipCACheck -SkipCNCheck -SkipRevocationCheck  
New-PSSession -UseSSL -ComputerName -SessionOption $httpsOptions -Credential (get-Credential) -Authentication Basic

And then type in the local user at the credential prompt (Administrator/MyPassword)

---

<div class="post-metadata">

**Author:** ![Jonathan\_Anderson](https://avatars.discourse-cdn.com/v4/letter/j/45deac/32.png) [@Jonathan\_Anderson](https://forum.ansible.com/u/Jonathan_Anderson)\
**Post date:** [June 17, 2016, 6:42pm UTC](https://forum.ansible.com/t/http-disabled-while-configuring-winrm-service/21795/3 "2016-06-17T18:42:09Z")

</div>

Thanks for your reply, I’ve appreciated many of your contributions to this group.

I tried to connect to my remote node via powershell from three different computers and it failed on all of them with the following error message…

PS C:\windows\system32\> $httpsOptions = New-PSSessionOption -SkipCACheck -SkipCNCheck -SkipRevocationCheck  
New-PSSession -UseSSL -ComputerName 10.1.22.33 -SessionOption $httpsOptions -Credential (get-Credential) -Authentication Basic  
[10.1.22.33] Connecting to remote server failed with the following error message : The SSL connection cannot be established. Verify that the service on the remote host is properly configured to listen for HTTPS requests. Consult the logs and docum…

And I fail to connect from my linux management node too with the following errors…

“Name or service not know” or “Connection reset by peer”

I’m running your powershell script on the remote node to configure it but it seems like the following line fails

|
| |
| 

$httpsResult = New-PSSession -UseSSL -ComputerName “localhost” -SessionOption $httpsOptions -ErrorVariable httpsError -ErrorAction SilentlyContinue

 |
| |

Should I try passing in the thumbnail of the cert manually on the command line? If not what next?

---

<div class="post-metadata">

**Author:** ![Jonathan\_Anderson](https://avatars.discourse-cdn.com/v4/letter/j/45deac/32.png) [@Jonathan\_Anderson](https://forum.ansible.com/u/Jonathan_Anderson)\
**Post date:** [June 17, 2016, 6:52pm UTC](https://forum.ansible.com/t/http-disabled-while-configuring-winrm-service/21795/4 "2016-06-17T18:52:53Z")

</div>

\*Thumbprint

---

<div class="post-metadata">

**Author:** ![Jonathan\_Anderson](https://avatars.discourse-cdn.com/v4/letter/j/45deac/32.png) [@Jonathan\_Anderson](https://forum.ansible.com/u/Jonathan_Anderson)\
**Post date:** [June 20, 2016, 8:01pm UTC](https://forum.ansible.com/t/http-disabled-while-configuring-winrm-service/21795/5 "2016-06-20T20:01:17Z")

</div>

Turns out it was using the wrong hostname. On line 139 of the powershell script I had to hard-code the common name used for my certificate. Like this…

139 $valueset.Add('Hostname", “[ansibleAdmin.aa.bb.acme.com](http://ansibleadmin.aa.bb.acme.com/)”)

Now it works.
