Страница 4 из 4

Libcurl: could not parse PKCS12 file

Добавлено: 03 Июнь 2022, 10:49
Admin
Написал скрипт:

Код: Выделить всё

curl.exe --request POST --url "https://api.sberbank.ru:8443/prod/tokens/v2/oauth" ^
--header "authorization: Basic xxxxxxxx==" ^
--header "accept: application/json" ^
--header "content-type: application/x-www-form-urlencoded" ^
--header "rquid: xxxxxxxx" ^
--header "x-ibm-client-id: xxxxxxxx" ^
--data "grant_type=client_credentials&scope=https://api.sberbank.ru/qr/order.create" ^
--cert "xxxxxxxx.p12:xxxxxxxx" ^
--cert-type "P12"
Curl версия 7.78.0, результат:

Код: Выделить всё

curl: (60) SSL certificate problem: self signed certificate in certificate chain
More details here: https://curl.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.
Программа с libcurl той же версии нормально с сертификатом работает. Тут не знаю почему так пишет

Curl версия 7.79.0, результат:

Код: Выделить всё

curl: (58) could not parse PKCS12 file, check password, OpenSSL error error:0308010C:digital envelope routines::unsupport
ed

Libcurl: could not parse PKCS12 file

Добавлено: 03 Июнь 2022, 11:04
Дед Пахом
Admin писал(а): 03 Июнь 2022, 10:49 Curl версия 7.79.0, результат:
И у всех последующих версий тот же результат, верно?

Libcurl: could not parse PKCS12 file

Добавлено: 06 Июнь 2022, 1:42
Admin
Дед Пахом писал(а): 03 Июнь 2022, 11:04 И у всех последующих версий тот же результат, верно?
Так точно!

curl-7.79.0-win32-mingw
curl-7.79.1-win32-mingw
curl-7.80.0-win32-mingw
curl-7.83.0-win32-mingw
curl-7.83.1_3-win32-mingw

Libcurl: could not parse PKCS12 file

Добавлено: 06 Июнь 2022, 11:39
Дед Пахом
Сообщил о проблеме: https://github.com/curl/curl/issues/8966.

Libcurl: could not parse PKCS12 file

Добавлено: 06 Июнь 2022, 19:14
Дед Пахом
Сам Daniel Stenberg добавил к тикету метку "TLS", думаю, это хороший знак.

Libcurl: could not parse PKCS12 file

Добавлено: 07 Июнь 2022, 2:07
Admin
Спасибо.

Libcurl: could not parse PKCS12 file

Добавлено: 28 Июнь 2022, 19:02
Дед Пахом
Вышла версия 7.84.0, залил на FTP (/libcurl_bin/curl-7.84.0-win32-mingw/). curl -V говорит, что использует версию OpenSSL 3.0.4 (была 3.0.2).
Новых комментариев про наш баг репорт на GitHub нет.

Libcurl: could not parse PKCS12 file

Добавлено: 29 Июнь 2022, 1:49
Admin
Ничего не изменилось

Код: Выделить всё

[libcurl] TEXT: could not parse PKCS12 file, check password, OpenSSL error error:0308010C:digital envelope routines::unsupported

Libcurl: could not parse PKCS12 file

Добавлено: 29 Июнь 2022, 13:25
Ал
:nono:
может обновления для windows какие не установлены, с других раб.мест так же не работает?
- у меня не так давно ругалась в одной чужой софтине и что-то про openssl всё время, но оказалась причина в другом моменте и вылечилось установкой "ручками" kb4474419...

Libcurl: could not parse PKCS12 file

Добавлено: 29 Июнь 2022, 13:55
Дед Пахом
Admin писал(а): 29 Июнь 2022, 1:49 Ничего не изменилось
Добавил эту информацию. Может, и в OpenSSL написать?

Libcurl: could not parse PKCS12 file

Добавлено: 29 Июнь 2022, 21:50
Дед Пахом
Вот что пишут:
This is likely because OpenSSL 3 needs legacy algorithms explicitly loaded. AFAIK there is no way to do that in curl. You would have to change your OpenSSL config if it uses one (I think some can be built without) or look at the stackoverflow link and there is a way to convert your pkcs file.

https://stackoverflow.com/questions/725 ... nsupported
https://wiki.openssl.org/index.php/Open ... #Providers
Из ответа на StackOverflow я понял, что новый OpenSSL не поддерживает старые/небезопасные алгоритмы типа PKCS12, но есть возможность перегнать старый PKCS12 в новый.

Libcurl: could not parse PKCS12 file

Добавлено: 30 Июнь 2022, 2:21
Admin
Вопрос закрыт!
Этот вариант помог:

Код: Выделить всё

# 1.x.x
openssl pkcs12 -in old -nodes | openssl pkcs12 -export -descert -out new
Запускал на Debian, SSL 1
После конвертации все работает на libcurl 7.84.0.0
После отпуска все перегоню...

Libcurl: could not parse PKCS12 file

Добавлено: 30 Июнь 2022, 11:34
Дед Пахом
Закрыл тикет на GitHub.