WinRM / WSMan - getting SSL handshake error / TCP RST when connecting with IP address, correct connection when connecting with hostname While using Ansible to manage some AWS based Windows machines, when connecting using the IP as destination, on some machines I'm getting an SSL Error 


  credssp: HTTPSConnectionPool(host='18.217.233.26', port=5986): Max
  retries exceeded with url: /wsman (Caused by SSLError(SSLError(\"bad
  handshake: SysCallError(-1, 'Unexpected EOF')\",),))", "unreachable":
  true}


In wireshark it looks like TCP RST is sent by server

When connecting using hostname or FQDN the connection succeeds. 

I don't see any relevant log in the event logs on WSMan side.

Anybody have any experience with setting up winrm for Ansible and can assist?
I faced the same error .. You probably want to run ConfigureRemotingForAnsible.ps1 script with -ForceNewSSLCert option on your remote machines.

.\ConfigureRemotingForAnsible.ps1 -ForceNewSSLCert