服务器访问https链接报错SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

前段时间,在项目中遇到个很奇怪的问题,有地方同事报错说验证码经常验证失败(https),但我们自己尝试却是正常的,后来在后端保存了调取验证码链接的结果,才发现有两台后端机记录有大量的如下报错:
SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
在这里插入图片描述
大意就是:SSL证书问题,请验证CA证书是否正确,证书验证失败。。。
其它后端服务器却是正常的,没有类似报错。。。。

然后,直接在问题服务器上尝试使用curl 访问链接,报错提示如下:

curl: (60) SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
More details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
 of Certificate Authority (CA) public keys (CA certs). The default
 bundle is named curl-ca-bundle.crt; you can specify an alternate file
 using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
 the bundle, the certificate verification probably failed due to a
 problem with the certificate (it might be expired, or the name might
 not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
 the -k (or --insecure) option.

服务器访问https链接报错SSL3_GET_SERVER_CERTIFICATE:certificate verify failed_第1张图片

经查发现,是因为服务器缺少openssl-devel依赖包,而在调用openssl库文件时,需要使用到openssl-devel包
通过yum install openssl-devel安装依赖包
安装之后便可以正常访问了,emmmm…

你可能感兴趣的:(linux)