因证书过期导致Java 执行http相关动作失败

此处证书过期会导致java的http相关动作时报如下错误:

java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty

解决办法,更新证书,若是私有证书则先复制到对应系统的默认目录,若是公有的根证书,执行更新即可.

Debian / Ubuntu:

# cp your_cert_file /usr/local/share/ca-certificates/
sudo update-ca-certificates -f

RHEL / CentOS

# cp your_cert_file /etc/pki/ca-trust/source/anchors/
sudo update-ca-trust

Windows

#certutil -addstore -f "ROOT"  your_cert_file

版权声明:本文为c461522756原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。