curl openssl错误错误:0308010C:数字信封例程::不支持
我尝试使用Windows上的卷发来发布时间戳请求。需要身份验证,因此我使用p12文件。我收到错误消息,但是P12文件的密码正确。
命令:
curl --insecure --cert-type P12 --cert my.p12:mypassword -X POST -d @mytest.req <myTSURL>
错误消息:
curl:(58)无法解析PKCS12文件,检查密码,OpenSSL错误 错误:0308010C:数字信封例程:: Undpported
curl -v
curl 7.83.1 (x86_64-pc-win32) libcurl/7.83.1 OpenSSL/3.0.2 (Schannel) zlib/1.2.12 brotli/1.0.9 libidn2/2.3.2 libssh2/1.10.0 nghttp2/1.47.0 ngtcp2/0.5.0 nghttp3/0.4.1 libgsasl/1.10.0
Release-Date: 2022-05-11
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS brotli gsasl HSTS HTTP2 HTTP3 HTTPS-proxy IDN IPv6 Kerberos Largefile libz MultiSSL NTLM SPNEGO SSL SSPI TLS-SRP UnixSocket
I try to use curl on Windows to post a timestamp request. Authentication is needed, so I use p12 file. I get error message, but password of p12 file is correct.
Command:
curl --insecure --cert-type P12 --cert my.p12:mypassword -X POST -d @mytest.req <myTSURL>
Error message:
curl: (58) could not parse PKCS12 file, check password, OpenSSL error
error:0308010C:digital envelope routines::unsupported
curl -V
curl 7.83.1 (x86_64-pc-win32) libcurl/7.83.1 OpenSSL/3.0.2 (Schannel) zlib/1.2.12 brotli/1.0.9 libidn2/2.3.2 libssh2/1.10.0 nghttp2/1.47.0 ngtcp2/0.5.0 nghttp3/0.4.1 libgsasl/1.10.0
Release-Date: 2022-05-11
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS brotli gsasl HSTS HTTP2 HTTP3 HTTPS-proxy IDN IPv6 Kerberos Largefile libz MultiSSL NTLM SPNEGO SSL SSPI TLS-SRP UnixSocket
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
META:这不是真正的编程或开发,并且在超级用户或安全性上可能会更好。
openssl 3.0.x(and UP)默认情况下不支持旧/不安全算法,但是直到最近,大多数创建PKCS12(包括OpenSSL 1.xx)的软件都使用了Certbag的算法(S) PBE使用40位RC2(通常是缩写的RC2-40) - 默认情况下,有时至少有时仍然会这样做,例如Windows 10 Cert-Export对话框。要检查此操作
,我希望输出将包括
您的curl是否有选项来指定OpenSSL 3.0.x提供商,如果是这样,则指定(固定)“遗产”和“默认”。否则,转换您的PKCS12(例如
转换)将在现有文件中丢失任何“友好名称”。对于卷曲,可能是大多数其他程序,这并不重要,但是如果您想将同一文件与friendersname 做重要的内容相同,请添加
-name $ name
在-Export
零件上。Meta: this isn't really programming or development, and would probably be better on superuser or maybe security.SX, but this is issue is likely to become more common as OpenSSL 3.0 spreads and I wanted to get the answer out.
OpenSSL 3.0.x (and up) by default doesn't support old/insecure algorithms, but until recently most software that creates PKCS12 (including OpenSSL 1.x.x) used such an algorithm for the certbag(s), namely a PKCS12-defined PBE using 40-bit RC2, usually abbreviated RC2-40 – and some still does at least sometimes, like the Windows 10 cert-export dialog by default. To check this do
and I expect the output will include
See if your curl has an option to specify the OpenSSL 3.0.x providers and if so specify (fixed) both 'legacy' and 'default'. Otherwise, convert your pkcs12 like
Conversion loses any 'friendlyname' set in the existing file. For curl, and probably most other programs, this doesn't matter, but if you want to use this same file with something where friendlyname does matter, add
-name $name
on the-export
part.使用OpenVPN,我遇到了相同的错误。我能够通过在
/etc/ssl/openssl.cnf
配置文件中添加或删除以下几行来对其进行修复:这是基于
I was getting the same error using OpenVPN. I was able to fix it by adding or uncommenting the following lines in the
/etc/ssl/openssl.cnf
configuration file:This is based on the information at OpenSSL WIKI
试图检查我的Mac上的P12,我正在
为我工作
openssl pkcs12 -in devcertificates.p12 -info -nodes -legacy
因此,您需要添加
-nodes -nodes -legacy
https://www.iclarified.com/92617/how-to-foc-fix-error-0308010c-digital-envelope-envelope-routines-unsuported-unsuported
Trying to inspect a p12 on my mac I was getting
This worked for me
openssl pkcs12 -in DEVCertificates.p12 -info -nodes -legacy
So you I need to add
-nodes -legacy
https://www.iclarified.com/92617/how-to-fix-error-0308010c-digital-envelope-routines-unsupported
在类似Unix(Linux,MacOS,Git Bash等)上:
这可以解决我的问题
https://github.com/webpack/webpack/issues/14532#issuecomment- 947012063
On Unix-like (Linux, macOS, Git bash, etc.):
This fix my problem
https://github.com/webpack/webpack/issues/14532#issuecomment-947012063