object has no attribute 'TLSv1_2_METHOD'"

1.7k views Asked by At

attempting to use CREDSSP with ansible over windows connections, have everything configured and pywinrm[credssp] installed but get thie above error when attempting to run credssp jobs:

"changed": false,
"msg": "credssp: 'module' object has no attribute 'TLSv1_2_METHOD'",
"unreachable": true

Any idea?

Tried:

Failed to install Python Cryptography package with PIP and setup.py

Requires this command: sudo yum install gcc libffi-devel python-devel openssl-devel

After that do a pip install --upgrade pywinrm[credssp] ...

Still does not work

1

There are 1 answers

0
Dário Estevão On

In my environment, the problem was pyOpenSSL. When updating pyOpenSSL to a new version using pip, some olders files were left in the directory.

I removed the package via pip uninstall, removed the directory in /usr/lib[64]/python2.7/site-packages/OpenSSL/ and then reinstalled pyopenssl.