openssl

OpenSSL FIPS_mode_set not working in Python cryptography library

OpenSSL FIPS_mode_set not working in Python cryptography library Question: According to Python Cryptography library’s documentation [1], it is possible to build a custom cryptography wheel with OpenSSL statically linked. I tried doing this with an OpenSSL installation built with FIPS object module and was able to successfully build the wheel but found out that it …

Total answers: 1

Protocol "https" not supported or disabled in libcurl ubuntu python

Protocol "https" not supported or disabled in libcurl ubuntu python Question: I am trying to run a repository from github in ubuntu18. after running python3 setup.py develop –user I got the error CMake Error at libmypaint-stamp/download-libmypaint.cmake:159 (message): Each download failed! error: downloading ‘https://github.com/mypaint/libmypaint/releases/download/v1.3.0/libmypaint-1.3.0.tar.xz’ failed status_code: 1 status_string: “Unsupported protocol” log: — LOG BEGIN — Protocol …

Total answers: 3

How do I read(open) an ASN.1 file in python

How do I read(open) an ASN.1 file in python Question: I want to get a certificates serial number using python: der = open(‘/Users/me/MyApp/Payload/codesign0’).read()“` cert = OpenSSL.crypto.load_certificate(OpenSSL.crypto.FILETYPE_ASN1, der cert.get_serial_number() Unfortunately it fails in the first line: UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0x82 in position 1: invalid start byte How do I read an ASN.1 file …

Total answers: 3

How to set ciphers in ssl python socket

How to set ciphers in ssl python socket Question: I want to create my own list of ciphersuites using the cipher strings. The following code works if I put only one string in the set_ciphers function. But I want a customized list of ciphers. There is other format like: ALL:!COMPLEMENTOFDEFAULT:!eNULL but this does not do …

Total answers: 2

How to enable FIPS mode for libcrypto and libssl packaged with Python?

How to enable FIPS mode for libcrypto and libssl packaged with Python? Question: I have a python application which comes packaged with Python and Libcrypto and LibSSL shared objects. The application was built with Openssl Fips Module 2.0. These shared objects are used by Python’s request module and urllib3 under the hood to make TLS …

Total answers: 1

Python AttributeError: 'module' object has no attribute 'SSL_ST_INIT'

Python AttributeError: 'module' object has no attribute 'SSL_ST_INIT' Question: A Python script of mine is failing with: Traceback (most recent call last): File “./inspect_sheet.py”, line 21, in <module> main() File “./inspect_sheet.py”, line 12, in main workbook_name=workbook_name, File “./google_sheets.py”, line 56, in __init__ self.login() File “./google_sheets.py”, line 46, in login self.client = gspread.authorize(credentials) File “/usr/local/lib/python2.7/site-packages/gspread/client.py”, line …

Total answers: 23

SSLError: sslv3 alert handshake failure

SSLError: sslv3 alert handshake failure Question: I’m making the following call to branch.io import requests req = requests.get(‘https://bnc.lt/m/H3XKyKB3Tq’, verify=False) It works fine in my local machine but fails in the server. SSLError: [Errno 1] _ssl.c:504: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure Openssl versions: local: OpenSSL 0.9.8zg 14 July 2015 server: OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008 Python: …

Total answers: 1

How to import OpenSSL in python

How to import OpenSSL in python Question: I am trying to run this simple code to retrieve SSL certificate: import ssl, socket #print ssl.get_server_certificate((‘www.google.com’, 443)) cert=ssl.get_server_certificate((‘www.google.com’, 443)) # OpenSSL x509 = OpenSSL.crypto.load_certificate(OpenSSL.crypto.FILETYPE_PEM, cert) x509.get_subject().get_components() But I get error saying: Traceback (most recent call last): File “C:UserseDesktopPythonssltest.py”, line 6, in <module> x509 = OpenSSL.crypto.load_certificate(OpenSSL.crypto.FILETYPE_PEM, cert) NameError: …

Total answers: 2

AttributeError: 'Context' object has no attribute 'wrap_socket'

AttributeError: 'Context' object has no attribute 'wrap_socket' Question: I am trying to set up a Flask server that uses an OpenSSL context. However, since I moved the script on a different server, it keeps throwing the following error, no matter if I am using Python 2.7 or 3.4 and no matter which SSL method I …

Total answers: 1