pyca/pyopenssl

Latest version of the pyopenssl library giving following error

radakrr opened this issue · 16 comments

we have upgraded the latest version of the library based on the error message we got as it was deprecated. AS soon we have done that we are getting following error.
MicrosoftTeams-image (5)

Since I couldn't copy the image here is the issue

AttributeError: module OpenSSL.crypto has no attribute "load_pkcs12"

Any help is appreciated??

need help as we are stuck?

any one I call get help

mhils commented

From https://github.com/pyca/pyopenssl/blob/main/CHANGELOG.rst#2330-2023-10-25:

Removed OpenSSL.crypto.loads_pkcs7 and OpenSSL.crypto.loads_pkcs12 which had been deprecated for 3 years.

You need to update your application code to use the PKCS12 APIs provided by pyca/cryptography.

Mhils,

we are using PKCS12 APIs provided by pyca/cryptography as suggested in the article you mentioned above.

mhils commented

You're trying to import load_pkcs12 from OpenSSL.crypto, which has been removed.

let me get my developer in this discussion..
I am not the expert here. I am trying find a solution
what should Import?

sorry to bother you mhils.. we are in a jam that is why I got involved.

here is the section which can help u:
import contextlib

import OpenSSL.crypto

import requests
import tempfile
import re
import json
import urllib
from datetime import date
import pandas as pd
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.primitives.serialization import load_pem_private_key
from cryptography.hazmat.primitives.serialization import pkcs12
from cryptography.hazmat.primitives.serialization.pkcs12 import load_key_and_certificates

sorry

#import OpenSSL.crypto

we have commented this line

Here is my management question- How come it was working last week and stop working when we upgraded it to latest version??

Mhils, should I open a new ticket since I really need help urgently. Sorry for being a pest. I am in trouble with timeline due to this issue. please help me.

alex commented

No, you should not open a new issue.

You've been given an answer as to why this isn't a pyopenssl bug, and you continue to ask incredibly basic programming questions.

We cannot provide basic programming support here.

Alex, thanks for your view. However, I am not the programmer and trying find an answer. trying to figure out this from common sense perspective. it was working before last week and giving the following error and it is clearly related to upgraded library. if you know the answer even if it basic programming. I am just asking to help because this upgrade. Nobody in my company has seen this error message and I am left with no help.
do u have a copy of readme file or something which can give me a clue.

It is pretty unexpected (for me personally anyway) to see an API breaking change like this occur on a minor version bump from 23.2.0 --> 23.3.0.

Is there any documentation on migrating from version 23.2.0 to 23.3.0?

Hi @mhils, do you have an answer to @greyltc's question above? Searching the docs for keywords does not yield instructions to migrate. Thanks!

It is pretty unexpected (for me personally anyway) to see an API breaking change like this occur on a minor version bump from 23.2.0 --> 23.3.0.

pyOpenSSL does not follow semantic versioning, this merely denotes the third release of 2023.

Hi @mhils, do you have an answer to @greyltc's question above? Searching the docs for keywords does not yield instructions to migrate. Thanks!

As mentioned above: You need to update your application code to use the PKCS12 APIs provided by pyca/cryptography.

My team is also using the PKCS12 APIs provided by pyca/cryptography and they dont seem to have the exact same functions. Do you guys own that library as well or no? Could you provide links to migration please @mhils