gpt4 book ai didi

c - OpenSSL 1.0.2 和错误 "SSL_CTX_new:library has no ciphers"

转载 作者:可可西里 更新时间:2023-11-01 10:15:41 25 4
gpt4 key购买 nike

我正在尝试编译并运行来自 libest 的示例(客户端简单)。为此,我在 Windows 上编译了 OpenSSL,然后用它编译并链接了 libest。

问题是当我运行程序时,我得到了error:140A90A1:SSL routines:SSL_CTX_new:library has no ciphers:

enter image description here

查看调试器中的代码,我可以确认调用了 OPENSSL_add_all_algorithms_noconf,以及:

  • ERR_load_crypto_strings()
  • ENGINE_load_builtin_engines();
  • SSL_library_init();
  • SSL_load_error_strings();

可能缺少/需要配置什么以允许 OpenSSL 找到密码套件?如果我运行与 openSSL 的 .lib 和 .dll 同时构建的 openSSL.exe,它会列出许多密码。

导致错误的实际调用是 SSL_CTX_new(SSLv23_client_method()))。但如果我更改客户端方法,它不会改变。

我为什么会遇到错误,我该如何解决?

最佳答案

您需要使用 TLS 1.1 或更高版本。您可能还需要服务器名称指示 (SNI)。 SNI 已通过下面的 -servername 登记。

我们需要查看更多代码来告诉您问题出在哪里。同时,您可能想访问 SSL/TLS Client在 OpenSSL 维基上。 (看起来该站点目前正在进行一些维护。这是来自 the Wayback machine 的存档版本)。

TLS 1.2:

$ openssl s_client -connect testrfc7030.cisco.com:9443 -servername testrfc7030.cisco.com -tls1_2
...
New, TLSv1.2, Cipher is ECDHE-RSA-AES256-GCM-SHA384
Server public key is 2048 bit
Secure Renegotiation IS supported
No ALPN negotiated
SSL-Session:
Protocol : TLSv1.2
Cipher : ECDHE-RSA-AES256-GCM-SHA384
Session-ID: B04740547F80E8F8BFC1B966D28C861F590E7ABB31202E2ED343EFDBA1A08867
Session-ID-ctx:
Master-Key: C6EF3571832C482E1293E78B0410E544140182858A91DDE16FD32CF248D442673C47C902A560A541B1D6C417E35DF804
PSK identity: None
PSK identity hint: None
SRP username: None
Start Time: 1478031623
Timeout : 7200 (sec)
Verify return code: 20 (unable to get local issuer certificate)
Extended master secret: no

TLS 1.1:

$ openssl s_client -connect testrfc7030.cisco.com:9443 -servername testrfc7030.cisco.com -tls1_1
...
New, SSLv3, Cipher is ECDHE-RSA-AES256-SHA
Server public key is 2048 bit
Secure Renegotiation IS supported
No ALPN negotiated
SSL-Session:
Protocol : TLSv1.1
Cipher : ECDHE-RSA-AES256-SHA
Session-ID: 62324F8BE5178E801F76B4737DD9F711AC0072E885B8748BB5B8F3ED3D16C8DE
Session-ID-ctx:
Master-Key: 4E44928C5E395E80AEF02533DAA0D237C58B5153CCCA16150B2DEDE361043BFB69D534F52A203084871F1683BDB241EF
PSK identity: None
PSK identity hint: None
SRP username: None
Start Time: 1478031773
Timeout : 7200 (sec)
Verify return code: 20 (unable to get local issuer certificate)
Extended master secret: no

TLS 1.0:

$ openssl s_client -connect testrfc7030.cisco.com:9443 -servername testrfc7030.cisco.com -tls1
CONNECTED(00000003)
write:errno=54
---
no peer certificate available
...
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
No ALPN negotiated
SSL-Session:
Protocol : TLSv1
Cipher : 0000
Session-ID:
Session-ID-ctx:
Master-Key:
PSK identity: None
PSK identity hint: None
SRP username: None
Start Time: 1478031817
Timeout : 7200 (sec)
Verify return code: 0 (ok)
Extended master secret: no

关于c - OpenSSL 1.0.2 和错误 "SSL_CTX_new:library has no ciphers",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40365295/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com