Questions tagged [pyopenssl]

Pyopenssl is a Python interface to the OpenSSL library.

Pyopenssl is a Python interface to the OpenSSL library.

480 questions
5
votes
2 answers

Python SSLError, sslv3 alert handshake failure, for wallhaven.cc

Python Version: 3.5.2 OS: OS X 10.12 OpenSSL Version: OpenSSL 1.1.0b 26 Sep 2016 I'm trying to requests "https://alpha.wallhaven.cc". import urllib.request init_page=urllib.request.urlopen("https://alpha.wallhaven.cc") Then get ssl.SSLError: [SSL:…
Amanthul
  • 51
  • 1
  • 1
  • 3
5
votes
1 answer

Python OpenSSL: How to create an X509Name object

I need to filter incoming X509 certificates by issuer, and I am using Pyhton's OpenSSL.crypto for this. However, I did not find how to create an X509Name object as a constant, which I need to compare with the value I get from cert.get_issuer().
rhoerbe
  • 463
  • 1
  • 4
  • 17
5
votes
3 answers

Non-detached PKCS#7 SHA1+RSA signature without M2Crypto

I'm trying to create a non-detached signature on python3. I currently have code that does this on python2 with m2crypto, but m2crypto isn't available for python3. I've been trying rsa, pycrypto and openssl, but haven't seen to find how. Here's the…
WhyNotHugo
  • 9,423
  • 6
  • 62
  • 70
5
votes
2 answers

Loading private key fails with OpenSSL.crypto.Error: []

I'm trying to load a private key using OpenSSL with: from OpenSSL import crypto PRIVATE_KEY = 'private_key.pem' with open(PRIVATE_KEY, 'rb') as fh: private_key = crypto.load_privatekey(crypto.FILETYPE_PEM, fh.read(), '') But I'm receiving this…
Uyghur Lives Matter
  • 18,820
  • 42
  • 108
  • 144
5
votes
2 answers

How can I force python apns-client to avoid using SSL 3?

A vulnerability was recently found in SSL 3, and Apple decided to turn it off for push notifications (APNS). Here is the announcement published on Oct 22, 2014. For the last few days, my development push server has been crashing with this…
MiniQuark
  • 46,633
  • 36
  • 147
  • 183
5
votes
2 answers

get public key from private key with python OpenSSL

Well, I generate a private key with pyOpenSSL as follows: from OpenSSL import crypto k = crypto.PKey() k.generate_key(crypto.TYPE_RSA, 2048) print crypto.dump_privatekey(crypto.FILETYPE_PEM, k) How do I get the public key string from it? I've still…
ScotchAndSoda
  • 3,811
  • 4
  • 34
  • 38
5
votes
1 answer

Trying to install Scrapy - error: Could not find 'openssl.exe'

Any thoughts on how to fix this problem? I am using pip to install Scrapy on a Win XP Pro SP 3 machine. I have Python 2.7 installed on the machine. There seems to be a problem with pyOpenSSL. I am getting a "Could not find 'openssl.exe'"…
dorkboy
  • 447
  • 1
  • 7
  • 10
4
votes
2 answers

Build the project in Git Actions using SAM, I am getting new error: AttributeError: module 'lib' has no attribute 'OpenSSL_add_all_algorithms'

I am using Python 3.9 and I am trying to build the code in Git Actions. I am seeing this new error today.Till 30th Dec, I didnt face any issue while building the same code. I am not explicitly using any PyOpenSSL package/ Cryptography package.So its…
4
votes
1 answer

error: Apple Arm64 ABI requires ffi_prep_cif_var

I have updated my Intel mac to Big Sur v11.0.1 and have a failing dependancy on one of my work projects. I do not use python so am unsure on how to progress with this bug. All of my other pip installs worked without troubles. So when I run pip3…
Charklewis
  • 4,427
  • 4
  • 31
  • 69
4
votes
2 answers

How to load all the certificates in a PEM-encoded certificate chain?

When I use OpenSSL.crypto.load_certificate(b'< PEM encoded certificate bytes >') function on a PEM encoded full certificate chain, only the first certificate is loaded as a OpenSSL.crypto.X509 object. The remaining certificates are completely…
Chris W.
  • 37,583
  • 36
  • 99
  • 136
4
votes
4 answers

extracting public key from certificate and encrypting data

This is for a homework assignment! I get the server's certificate using get_peer_certificate() and the calling dump_certificate to dump the certificate in a variable. The format is PEM and looks right to me. -----BEGIN…
Lelouch Lamperouge
  • 8,171
  • 8
  • 49
  • 60
4
votes
1 answer

SSLError: Python Server Failure (HTTP_REQUEST _ssl.c:777)

My application has a server wherein waiting for a connection is made as follow: sckt = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server = ('', port_server) sckt.bind(server) sckt.listen(5) try: while True: new_sckt, client =…
candrebc
  • 41
  • 1
  • 2
4
votes
1 answer

requests.exceptions.SSLError: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590)

I am trying to access a website with the requests package like this page = requests.get('https://jobregister.aas.org') but I get the following Traceback (most recent call last): File "daily.py", line 453, in main() File…
carl
  • 4,216
  • 9
  • 55
  • 103
4
votes
1 answer

How to generate a certificate using pyOpenSSL to make it secure connection?

I generate self-signed-cert CA_KEY_FILE = os.path.join(settings.ROOT_CRT_PATH, 'rootCA.key') CA_CERT_FILE = os.path.join(settings.ROOT_CRT_PATH, 'rootCA.crt') def create_self_signed_cert_root(cleanned_data): k =…
4
votes
0 answers

HTTPS request using DES-CBC-SHA and latest version of Python?

I'm trying to set up https connection from Python on Windows using Requests to Cisco ASA firewall which does not have AES/3DES license installed. The goal is to download pcap capture file from URL pattern https://10.0.0.1/capture/TEST_CAPTURE/pcap…
Andrey Grachev
  • 1,259
  • 1
  • 14
  • 22