你已经得到你的问题了。其实你的证书已经过期了。
您的网络服务的应用程序服务器需要更新其证书。
如需完整教程创建并检查证书你可以按照教程操作:
- 最常见的 OpenSSL 命令 https://www.sslshopper.com/article-most-common-openssl-commands.html
- 如何从 Shell 提示符验证 SSL 证书 http://www.cyberciti.biz/faq/test-ssl-certificates-diagnosis-ssl-certificate/
更改证书,您可以按照教程操作:
http://www.albeesonline.com/blog/2009/06/24/javax-net-ssl-sslhandshakeexception-certificate-expired/ http://www.albeesonline.com/blog/2009/06/24/javax-net-ssl-sslhandshakeexception-certificate-expired/
完整教程:
出于测试目的,我将使用mail.google.com:443
SSL 证书由以下机构颁发Go Daddy
.
步骤#1:获取证书
创建存储证书的目录:
$ mkdir -p ~/.cert/mail.google.com/
$ cd ~/.cert/mail.google.com/
检索mail.google.com
google邮件服务器提供的证书:
$ openssl s_client -showcerts -connect mail.google.com:443
从“----BEGIN CERTIFICATE-----”复制到“-----END CERTIFICATE-----”,
并将其保存在您的~/.cert/mail.google.com/
目录为mail.google.com.pem
.
步骤#2:获取发行人的证书
如果此证书是由 GoDaddy 颁发的,那么您需要获取“证书颁发机构根证书”(访问您的 CA 网站获取根证书):
$ wget https://certs.godaddy.com/repository/gd_bundle.crt -O ~/.cert/mail.google.com/gd.pem
步骤#3:重新哈希证书
使用以下命令创建指向由哈希值命名的文件的符号链接c_rehash
, enter:
$ c_rehash ~/.cert/mail.google.com/
示例输出:
Doing ~/.cert/mail.google.com/
mail.google.com.pem => 1d97af50.0
gd.pem => 219d9499.0
Test It
要确认您拥有正确的工作证书,请输入:
$ openssl s_client -CApath ~/.cert/mail.google.com/ -connect mail.google.com:443
示例输出:
CONNECTED(00000003)
......
....
Verify return code: 0 (ok)
---
应该有很多数据,但是要注意的重要一点是最后一行“Verify return code: 0 (ok)”
。我对 dovecot IMAP 邮件服务器使用相同的证书,输入以下内容来验证邮件服务器 SSL 证书:
$ openssl s_client -CApath ~/.cert/mail.google.com/ -connect mail.google.com:993
示例输出:
CONNECTED(00000003)
.....
.....
Verify return code: 0 (ok)
---
* OK [CAPABILITY IMAP4rev1 SASL-IR SORT THREAD=REFERENCES MULTIAPPEND UNSELECT LITERAL+ IDLE CHILDREN NAMESPACE LOGIN-REFERRALS UIDPLUS LIST-EXTENDED I18NLEVEL=1 QUOTA AUTH=PLAIN AUTH=LOGIN] Dovecot ready.
再次是最后的“鸽舍准备就绪”线0 return code indicates that everything is working fine
.
资源链接:
验证私钥与证书是否匹配 https://kb.wisc.edu/middleware/page.php?id=4064