# Cannot use signature-based authentication because pyopenssl is not available

**URL:** <https://forum.ansible.com/t/cannot-use-signature-based-authentication-because-pyopenssl-is-not-available/31358>\
**Category:** Ansible Project\
**Tags:** windows, ubuntu\
**Created:** [September 24, 2019, 11:23pm UTC](https://forum.ansible.com/t/cannot-use-signature-based-authentication-because-pyopenssl-is-not-available/31358 "2019-09-24T23:23:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Antien\_Ho](https://avatars.discourse-cdn.com/v4/letter/a/3bc359/32.png) [@Antien\_Ho](https://forum.ansible.com/u/Antien_Ho)\
**Post date:** [September 24, 2019, 11:23pm UTC](https://forum.ansible.com/t/cannot-use-signature-based-authentication-because-pyopenssl-is-not-available/31358/1 "2019-09-24T23:23:31Z")

</div>

environment: windows 10 Ubuntu 18.04 LTS.  
python version as standard:

ansible-playbook 2.8.5  
config file = /etc/ansible/ansible.cfg  
configured module search path = [u’/home/antienho/.ansible/plugins/modules’, u’/usr/share/ansible/plugins/modules’]  
ansible python module location = /usr/lib/python2.7/dist-packages/ansible  
executable location = /usr/bin/ansible-playbook  
python version = 2.7.15+ (default, Jul 9 2019, 16:51:35) [GCC 7.4.0]  
Using /etc/ansible/ansible.cfg as config file

in a ACI environment, and installed the openssl cert key with .pem and .key  
by following  
openssl req -new -newkey rsa:1024 -days 36500 -nodes -x509 -keyout antien.key -out antien.pem -subj ‘/CN=Antien/O=conreslab/C=US’.

the .pem is properly installed in ACI.  
however when run the simple yml file.  
I always getting the topic error. pyopenssl is not available.

I did install the pyopenssl with “pip3 install pyopenssl”…as latest pyopenssl 19.0.0 version…see below:

pip3 install pyopenssl  
Collecting pyopenssl  
Using cached [https://files.pythonhosted.org/packages/01/c8/ceb170d81bd3941cbeb9940fc6cc2ef2ca4288d0ca8929ea4db5905d904d/pyOpenSSL-19.0.0-py2.py3-none-any.whl](https://files.pythonhosted.org/packages/01/c8/ceb170d81bd3941cbeb9940fc6cc2ef2ca4288d0ca8929ea4db5905d904d/pyOpenSSL-19.0.0-py2.py3-none-any.whl)  
Collecting six\>=1.5.2 (from pyopenssl)  
Using cached [https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl](https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl)  
Collecting cryptography\>=2.3 (from pyopenssl)  
Using cached [https://files.pythonhosted.org/packages/97/18/c6557f63a6abde34707196fb2cad1c6dc0dbff25a200d5044922496668a4/cryptography-2.7-cp34-abi3-manylinux1\_x86\_64.whl](https://files.pythonhosted.org/packages/97/18/c6557f63a6abde34707196fb2cad1c6dc0dbff25a200d5044922496668a4/cryptography-2.7-cp34-abi3-manylinux1_x86_64.whl)  
Collecting cffi!=1.11.3,\>=1.8 (from cryptography\>=2.3-\>pyopenssl)  
Using cached [https://files.pythonhosted.org/packages/5f/bf/6aa1925384c23ffeb579e97a5569eb9abce41b6310b329352b8252cee1c3/cffi-1.12.3-cp36-cp36m-manylinux1\_x86\_64.whl](https://files.pythonhosted.org/packages/5f/bf/6aa1925384c23ffeb579e97a5569eb9abce41b6310b329352b8252cee1c3/cffi-1.12.3-cp36-cp36m-manylinux1_x86_64.whl)  
Collecting asn1crypto\>=0.21.0 (from cryptography\>=2.3-\>pyopenssl)  
Using cached [https://files.pythonhosted.org/packages/ea/cd/35485615f45f30a510576f1a56d1e0a7ad7bd8ab5ed7cdc600ef7cd06222/asn1crypto-0.24.0-py2.py3-none-any.whl](https://files.pythonhosted.org/packages/ea/cd/35485615f45f30a510576f1a56d1e0a7ad7bd8ab5ed7cdc600ef7cd06222/asn1crypto-0.24.0-py2.py3-none-any.whl)  
Collecting pycparser (from cffi!=1.11.3,\>=1.8-\>cryptography\>=2.3-\>pyopenssl)  
Installing collected packages: six, pycparser, cffi, asn1crypto, cryptography, pyopenssl  
Successfully installed asn1crypto-0.24.0 cffi-1.12.3 cryptography-2.7 pycparser-2.19 pyopenssl-19.0.0 six-1.12.0

I will post any addition information if required. Any suggestions are appreciated.

Thanks

Antien

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [September 25, 2019, 3:58am UTC](https://forum.ansible.com/t/cannot-use-signature-based-authentication-because-pyopenssl-is-not-available/31358/2 "2019-09-25T03:58:08Z")

</div>

Your ansible is using python2.

So either install ansible using python3, or install pyopenssl for python2 (if that’s possible at all, can’t tell from here).

Dick

---

<div class="post-metadata">

**Author:** ![vbotka](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/vbotka/32/359_2.png) [@vbotka](https://forum.ansible.com/u/vbotka)\
**Post date:** [September 25, 2019, 4:28am UTC](https://forum.ansible.com/t/cannot-use-signature-based-authentication-because-pyopenssl-is-not-available/31358/3 "2019-09-25T04:28:59Z")

</div>

Install PyOpenSSL on the remote host. Quoting from the doc:

&nbsp;&nbsp;PyOpenSSL is "needed on the host that executes this module"  
&nbsp;&nbsp;[https://docs.ansible.com/ansible/latest/modules/openssl\_certificate\_module.html](https://docs.ansible.com/ansible/latest/modules/openssl_certificate_module.html)

What Python shall be used on the remote host depends how the packages have  
been built and what packages were installed. For example FreeBSD works fine  
with both

&nbsp;&nbsp;py27-openssl-18.0.0 Python interface to the OpenSSL library  
&nbsp;&nbsp;py36-openssl-17.5.0\_1 Python interface to the OpenSSL library

If you have to use pip to install the packages make sure the paths are set  
properly and Ansible is able to use it.

Cheers,

&nbsp;&nbsp;-vlado
