java - PKIX 路径构建在 Centos 7 中失败

标签 java ssl centos7

sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target; nested exception is javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

触发 SSL 认证 URL 时收到以下异常。 尝试使用以下命令修复错误

/opt/jdk1.8.0_51/jre/bin/keytool -import –alias -genkey –keystore “/opt/jdk1.8.0_51/jre/lib/security/cacerts” -file /apps/binlistlookup/src/main/resources/binlistnet.crt

问题在centos 7系统中仍然存在。

最佳答案

1 。 keytool -genkey -keyalg RSA -alias selfsigned -keystore keystore.jks -storepass -validity 360 -keysize 2048

一些请求将显示询问您的一般数据。全部输入。

2。 keytool -v -list -keystore keystore.jks

3。 keytool -exportcert -rfc -alias selfsigned -keystore keystore.jks -file selfsigned.crt

4。 keytool -printcert -file selfsigned.crt

您的认证文件已准备就绪。

关于java - PKIX 路径构建在 Centos 7 中失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57255472/

相关文章:

java - KeyListener - 为什么 keyPressed 方法会延迟一种类型?

ssl - 用于加密的端口列表

java - 如果我在 HTTPS 服务器上禁用 SSLv2/SSLv3,Android 连接失败

javascript - Angular 和 Spring Rest api 通过 https 进行通信

linux - 在 centos 7 上使用 websockets 安装 mosquitto 时出错

java - Redis中如何实现Round-Robin?

java - 扩展 Swing 的 UndoManager 以提供重复和多个撤消/重做

java - 任意基数填充格式

php - 在 Centos 7 上完全卸载并重新安装 PHP

linux - 如何将 git 存储库共享给同一台机器上的特定用户?