- 论坛徽章:
- 0
|
本帖最后由 NewCore 于 2017-02-15 01:33 编辑
hi all,
知道本版人气旺,就发在这里吧。
偶的环境是- [root@localhost app_mon]# uname -r
- 2.6.25-14.fc9.i686
- [root@localhost app_mon]# rpm -qa | grep openssl
- openssl-devel-0.9.8g-6.fc9.i386
- openssl-0.9.8g-6.fc9.i686
复制代码 这个问题是在用openssl访问https网站时遇到的。因为是作为客户端访问公共的https网站,因此不需要提供客户端证书,大致流程既是;- 初始化大致是:
- https_serv->ctx = SSL_CTX_new(SSLv23_client_method());
- .......
- https_serv->ssl = SSL_new(https_serv->ctx);
- ......
- ret = SSL_set_fd(https_serv->ssl, serv_info->socket);
- .......
- SSL_CTX_set_verify(https_serv->ctx, SSL_VERIFY_NONE, NULL);
- ret = SSL_connect(https_serv->ssl);
- ......
- 在关闭连接的时候:
- ERR_free_strings();
- if(NULL != _entity->ssl) {
- SSL_shutdown(_entity->ssl);
- SSL_free(_entity->ssl);
- }
- if(NULL != _entity->ctx)
- SSL_CTX_free(_entity->ctx);
- if(-1 != _entity->sock)
- close(_entity->sock);
-
- free(_entity);
- 在执行到SSL_free的时候出现core dump, bt显示如下:
- (gdb) bt
- #0 0x0584dade in ASN1_STRING_free () from /lib/libcrypto.so.7
- #1 0x058444ac in ASN1_primitive_free () from /lib/libcrypto.so.7
- #2 0x058447f3 in ?? () from /lib/libcrypto.so.7
- #3 0x058448a6 in ASN1_template_free () from /lib/libcrypto.so.7
- #4 0x0584478f in ?? () from /lib/libcrypto.so.7
- #5 0x058448e8 in ASN1_item_free () from /lib/libcrypto.so.7
- #6 0x0583f057 in X509_free () from /lib/libcrypto.so.7
- #7 0x0596f510 in ssl_sess_cert_free () from /lib/libssl.so.7
- #8 0x05970205 in SSL_SESSION_free () from /lib/libssl.so.7
- #9 0x0596e0c0 in SSL_free () from /lib/libssl.so.7
- #10 0x0804ac08 in https_deinit ()
- #11 0x0804acc8 in app_mon_deinit ()
- #12 0x0804add7 in main ()
复制代码 注意到以下两行:
#2 0x058447f3 in ?? () from /lib/libcrypto.so.7
#4 0x0584478f in ?? () from /lib/libcrypto.so.7
是libcryto这个库有什么问题吗?
我网上找了很久,似乎没有人遇到过这个问题,有人能给点提示吗? |
|