"No subject alternative names present" solved
来源:互联网 发布:淘宝详情页懒人模板 编辑:程序博客网 时间:2024/06/16 19:59
这个异常有可能是SAN (Subject alternative name) 与CN (Common Name)没设置好引起。
网上翻阅了许多资料,下面记录一下解决的方法。
1. 拿着Server 给的server.jks EXPORT对应的CER 然后generate 自己CLIENT SIDE 的JKS. (用的是JAVA8)
keytool -genkeypair -alias testingkey2 -keyalg RSA -validity 365 -keystore server.jks -ext SAN=dns:localhost,ip:127.0.0.1
keytool -list -v -keystore server.jks
keytool -export -alias testingkey2 -keystore server.jks -rfc -file testing.cer
keytool -import -alias testingkey2 -file testing.cer -keystore client.jks
keytool -list -v -keystore client.jks
2. 在JAVA代码中或者startup batch中输入下面的代码,用来读取相对应的KEY。.
- java -Djavax.net.ssl.trustStore=Client.jks -Djavax.net.ssl.trustStorePassword=password
- Properties systemProps = System.getProperties();
- systemProps.put( "javax.net.ssl.trustStore", "Client.jks");
- systemProps.put( "javax.net.ssl.trustStorePassword", "password");
- System.setProperties(systemProps);
还有另一种方法就是用X509TrustManager 来实现,具体可以查考下面链接:
http://www.cnblogs.com/devinzhang/archive/2012/02/28/2371631.html
阅读全文
0 0
- "No subject alternative names present" solved
- “No subject alternative names present” 异常解决
- Spring Boot忽略https证书:No subject alternative names present
- Linux下tomcat配置ssl中报错的问题[已解决] CertificateException No subject alternative names present
- Caused by: java.security.cert.CertificateException: No subject alternative names present
- 【java细节】Java代码忽略https证书:No subject alternative names present
- No subject alternative names那些事
- Getting error "No subject alternative names" when doing secure URL connection(针对处理https连接的安全异常)(转:http://www.coderanch.com/t/134
- Subject: SOLVED IceFaces 2 Cookies
- Android Studio升级后 出现在No subject alternative DNS name matching services.gradle.org found.
- No Subject
- no subject
- C++ Keywords Alternative Operator Names
- No vendor names found
- no link present
- no bundle url present
- COJ--1541: There is No Alternative
- CSU--1541-- There is No Alternative
- Vim技能修炼教程(9)
- 全双工 半双工 单工 通信,同步和异步
- Unity平台判断
- 268. Missing Number
- RocketMQ实战(四)
- "No subject alternative names present" solved
- c++ 之 复数类的实现
- Friends and Subsequences
- vector(2)
- Gcc 安装
- 在linux中执行wget命令提示 -bash: wget: command not found 解决方法
- 学习笔记7.11
- Drupal学习 第五课
- stm32外部中断实验