- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
来自 cat/proc/version
的 Linux 版本
Linux version 3.6.11-4.fc16.i686 (mockbuild@bkernel02) (gcc version 4.6.3 20120306 (Red Hat 4.6.3-2) (GCC) )
来自 openssl version
命令:
OpenSSL 1.0.1g 7 Apr 2014
首先,我使用带有 cURL 的 REST API 执行 HTTP 请求,以从服务器(线程 1)获取一些配置。然后我创建一个 TLS channel 并通过该 channel (线程 2)登录到 XMPP 服务器。然后我尝试通过创建 TLS channel (Thread3) 登录到 SIP 服务器。但是 TLS channel 创建失败并出现此错误:
error:140A90F1:SSL routines:SSL_CTX_new:unable to load ssl2 md5 routines
SSL_library_init();
SSL_load_error_strings();
SSL_CTX* sslContext = SSL_CTX_new(SSLv3_method());
此处 sslContext
为 NULL。我在网上看到了很多关于这个错误的错误报告和邮件,但没有任何解决方案。我不知道它是否与 cURL 有关,但在很多情况下,人们在使用 cURL 时都会遇到这个问题。
有关此错误的其他人的帖子,请参阅以下链接。
https://issues.apache.org/bugzilla/show_bug.cgi?id=56027
http://comments.gmane.org/gmane.comp.lib.boost.asio.user/2099
http://en.it-usenet.org/thread/17225/526/
http://curl.haxx.se/mail/curlphp-2009-01/0020.html
编辑:
评论第一条命令的输出:
# openssl version -a
OpenSSL 1.0.1g 7 Apr 2014
built on: Tue Aug 12 10:07:53 BDT 2014
platform: linux-generic32
options: bn(64,32) rc4(ptr,char) des(idx,cisc,16,long) blowfish(ptr)
compiler: /home/moshiur/Documents/Workspace/ph_SDKs/Untitled_Folder/ph
OPENSSLDIR: "/etc/ssl"
# ls /etc/ssl/
certs misc openssl.cnf private
最佳答案
Openssl SSL_CTX_new(SSLv3_method()) returns NULL
调用:
OpenSSL_add_ssl_algorithms
SSL_load_error_strings
参见 Library Initialization在 OpenSSL 维基上。来自维基:
If you fail to initialize the library, then you will experience unexplained errors like SSL_CTX_new returning NULL, and alert handshake failure with no shared ciphers.
error:140A90F1:SSL routines:SSL_CTX_new:unable to load ssl2 md5 routines
听起来该库配置了 no-ssl2
和 no-md5
。这是 FIPS 配置吗?
配置定义在几个地方可用。首先,您可以检查(有时会显示定义):
$ /usr/local/ssl/macosx-x64/bin/openssl version -a
OpenSSL 1.0.1i 6 Aug 2014
built on: Wed Aug 6 18:45:03 EDT 2014
platform: darwin64-x86_64-cc
options: bn(64,64) rc4(ptr,char) des(idx,cisc,16,int) idea(int) blowfish(idx)
compiler: cc -fPIC -fno-common -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN
-DHAVE_DLFCN_H -arch x86_64 -O3 -DL_ENDIAN -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT
-DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM
-DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM
OPENSSLDIR: "/usr/local/ssl/macosx-x64"
其次,您可以使用 opensslconf.h
进行运行时检查。例如,您可以通过 OPENSSL_NO_SSL2
检查 no-ssl2
配置选项(这些定义始终显示):
$ cat /usr/local/ssl/macosx-x64/include/openssl/opensslconf.h | grep -A 1 -i SSL2
#ifndef OPENSSL_NO_SSL2
# define OPENSSL_NO_SSL2
#endif
--
# if defined(OPENSSL_NO_SSL2) && !defined(NO_SSL2)
# define NO_SSL2
# endif
您可以在代码中使用这些来保护功能。例如:
#ifndef OPENSSL_NO_SSL2
/* SSLv2 is available */
#endif
关于c++ - Openssl SSL_CTX_new(SSLv3_method()) 返回 NULL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25282939/
我正在尝试通过 SSL 作为客户端进行连接,但我看到了一些奇怪的行为。尝试创建新的 SSL 上下文时,我在 SSL_CTX_new 中遇到间歇性段错误。还应该注意的是,这是一个 fCGI 恶魔,并且只
我正在开发一个客户端应用程序,该应用程序使用 openssl 1.0.2f 使用 C++ 将数据流式传输到服务器,在连接开始后不久,对 SSL_CTX_new 的调用有 60% 的时间挂起。有时调用会
我对 SSL 很陌生,实际上我会说我对此一无所知。 我正在使用“SSL_CTX_new”方法创建一个 SSL_CTX 对象。该方法返回 null。文档说我可以检查错误堆栈以找出原因。 所以我有函数“i
来自 cat/proc/version 的 Linux 版本 Linux version 3.6.11-4.fc16.i686 (mockbuild@bkernel02) (gcc version 4
按照 page 上的说明进行操作,我正在尝试使用 openSSL 以安全的方式连接客户端/服务器。 我无法按如下方式创建 SSL_CTX: /* OpenSSL headers */ #inclu
我们在运行使用 OpenSSL 构建的程序时遇到问题。我们遇到的具体错误是:global error: SSL Context init failed error:140A90F1:SSL routi
我遇到了一个奇怪的 OpenSSL 问题:当我的应用程序作为 win32 服务(本地服务/网络服务或系统服务)运行时,SSL_CTX_new() 函数似乎崩溃了。 我的代码是这样的: int main
我正在尝试编译并运行来自 libest 的示例(客户端简单)。为此,我在 Windows 上编译了 OpenSSL,然后用它编译并链接了 libest。 问题是当我运行程序时,我得到了error:14
我正在尝试在我的应用程序中使用 libwebsockets ( http://libwebsockets.org/trac/libwebsockets ) 库来支持 websockets。我需要它是安
我有一个 flask 应用程序,它使用我在开发模式下成功运行的 mysql 连接。为了扩展应用程序,我打算结合使用 Nginx 和 uwsgi。 设置 wsgi.py 文件并运行命令: uwsgi -
我是一名优秀的程序员,十分优秀!