As I have stated in the issue this has nothing to do with certificate validation. If it was you will be getting a completely separate error message saying something like "certificate verify error" or something like that. This is an error that Python/OpenSSL reports when it cannot negotiate a common TLS protocol between the itself and the Windows server.
You can run the following to try and get some more info
ANSIBLE_PYTHON=$(head -1 $(which ansible) | cut -c 3-)
echo $ANSIBLE_PYTHON # Used to just display what Python Ansible is using
$ANSIBLE_PYTHON --version
# Make sure both match, if they don't then the openssl binary is at a different path and these tests won't indicate anything
$ANSIBLE_PYTHON -c "import ssl; print(ssl.OPENSSL_VERSION)"
openssl version
openssl s_client -connect hostname:5986
#
Prints a list of ciphers and the protocols that the openssl supports,
once again the binary should be the one Python is compiled against.
openssl ciphers -s -v
In my example here is a snippet of what I receive from the s_client -connect command
---
SSL handshake has read 2105 bytes and written 465 bytes
---
New, TLSv1/SSLv3, Cipher is ECDHE-RSA-AES256-GCM-SHA384
Server public key is 4096 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
SSL-Session:
Protocol : TLSv1.2
Cipher : ECDHE-RSA-AES256-GCM-SHA384
Session-ID: DA300000338CE777889199F6BFBB5D2D0922405E01E413959C82ABF8B5433E0D
Session-ID-ctx:
Master-Key: 62132D2AB686ABA5CEAB04DD0E92AD51140F658693E8643421207CDE599FF6588B00C2EC84E410F17E077856204735A8
Key-Arg : None
PSK identity: None
PSK identity hint: None
SRP username: None
Start Time: 1580898057
Timeout : 300 (sec)
Verify return code: 21 (unable to verify the first certificate)
---
You can see the protocol negotiated between the client and the server was TLSv1.2 which is good. In your case I would expect the handshake to fail because it cannot negotiate a common protocol. Once again you need to make sure the openssl binary you run is the one that your Python has been compiled against.
Typically when a common protocol is not found it means one of the following;
- Python's OpenSSL does not support TLS 1.2 and the Windows host only offers TLS 1.2
- Typical for older hosts talking to newer Windows versions
- MacOS before High Sierra used an ansible OpenSSL version which did not support TLS but based on your controller OS version I doubt this is the case for you
- Python's OpenSSL only supports TLS 1.2 or newer and the Windows host does not offer TLS 1.2
- Some newer distros disable older TLS protocol for security reasons
- TLS 1.2 has been enabled by default for Server 2012/Windows 8 or newer
- Server 2008 R2/Windows 7 need a security update to be applied and some registry settings tweaked
- https://www.nartac.com/Products/IISCrypto/Download is a great tool you can use to control the TLS protocol and ciphers offerred by a Windows server if you don't want to edit the registry
A final thing you can do is setup a Wireshark capture between the Ansible controller and Windows host, most of the data is going to be garbage due to the encryption but you can see the negotiation process happen in plain text. For example the controller will send a Client Hello message which advertises the protocols and cipher suites it can use
The Server Hello response tells you what protocol and cipher suite was ultimately chosen
Lastly I believe the Windows application or system event log shows errors when a client tries to access the server but the server does not have a common protocol, that's another good place to look.
Thanks
Jordan