Fix for Cannot recover key error in JAVA
2015-06-03 16:10
459 查看
This is how i fixed Cannot recover key error in JAVA while i was setting up an SSL configuration for one of the Application Servers. Following is the part of the exception that i noted in the error log of my app,I couldn't start
my tomcat and jboss servers because of the below error.
ERROR - Could not start server:java.security.UnrecoverableKeyException: Cannot recover key
java.io.IOException: !JsseListener: java.security.UnrecoverableKeyException: Cannot recover key
at org.mortbay.jetty.security.SslSocketConnector.newServerSocket(SslSocketConnector.java:516)
at org.mortbay.jetty.bio.SocketConnector.open(SocketConnector.java:73)
at org.mortbay.jetty.AbstractConnector.doStart(AbstractConnector.java:283)
at org.mortbay.jetty.bio.SocketConnector.doStart(SocketConnector.java:147)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
I see there are lot of post in google, but hard to find the exact solution, here it goes.
What causes this SSL error?
The answer is simple, the passwords of the Certificate Key and the generated keystore are different, they cannot be different and they should be same.If your certificate cer/crt/pfx key has a password called hpanswers then
your generated keystore file should also have a similar password called hpanswers, it cannot be different, so both the certificate key and the jks keystore file should have the same password.
You either need to regenerate the keystore with the same password as certificate key or change the password for both..Set the key password to be the same as keystore password, using the below java keytool command
The below is an example , here the certificate key password is oldpass and the key password is hpanswers, we are now changing they certificate key password to hpanswers
$ keytool -keypasswd -keystore test.jks -alias ssltest
Enter keystore password: hpanswers
Enter key password for ssltesr: oldpass
New key password for ssltest: hpanswers
Re-enter new key password for : hpanswers
Following is some useful information i noted while i was solving this posted on globalsign
How to Fix "Cannot Recover Key" Error
The error “java.security.UnrecoverableKeyException: Cannot recover key” occurs when the keystore and keyEntry passwords are different. To resolve this issue, you must remove all traces of the past certificate and request the file.
You must generate a new keystore, keyEntry and CSR. You must also specify the same password for the keystore and the keyEntry.
Useful References to understand this issue better.
java.io.IOException: Cannot recover key
Cannot recover
key tomcat
Fish Eye Server Error
Posted by Ans
Pri at Saturday,
November 22, 2014
转载:http://blog.csdn.net/lvron/article/details/7421548
Android开发中,用数字证书签名打包时
第一步: 输入keystore密码 通过
第二步:输入alias密码 不通过时 便会报这个错。
java.security.UnrecoverableKeyException: Cannot recover key
This exception may result from the fact that you had provided a key password that was different from the keystore password
此错误由调用getKey(alias,aliaspassword)函数抛出。
my tomcat and jboss servers because of the below error.
ERROR - Could not start server:java.security.UnrecoverableKeyException: Cannot recover key
java.io.IOException: !JsseListener: java.security.UnrecoverableKeyException: Cannot recover key
at org.mortbay.jetty.security.SslSocketConnector.newServerSocket(SslSocketConnector.java:516)
at org.mortbay.jetty.bio.SocketConnector.open(SocketConnector.java:73)
at org.mortbay.jetty.AbstractConnector.doStart(AbstractConnector.java:283)
at org.mortbay.jetty.bio.SocketConnector.doStart(SocketConnector.java:147)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
I see there are lot of post in google, but hard to find the exact solution, here it goes.
What causes this SSL error?
The answer is simple, the passwords of the Certificate Key and the generated keystore are different, they cannot be different and they should be same.If your certificate cer/crt/pfx key has a password called hpanswers then
your generated keystore file should also have a similar password called hpanswers, it cannot be different, so both the certificate key and the jks keystore file should have the same password.
You either need to regenerate the keystore with the same password as certificate key or change the password for both..Set the key password to be the same as keystore password, using the below java keytool command
The below is an example , here the certificate key password is oldpass and the key password is hpanswers, we are now changing they certificate key password to hpanswers
$ keytool -keypasswd -keystore test.jks -alias ssltest
Enter keystore password: hpanswers
Enter key password for ssltesr: oldpass
New key password for ssltest: hpanswers
Re-enter new key password for : hpanswers
Following is some useful information i noted while i was solving this posted on globalsign
How to Fix "Cannot Recover Key" Error
The error “java.security.UnrecoverableKeyException: Cannot recover key” occurs when the keystore and keyEntry passwords are different. To resolve this issue, you must remove all traces of the past certificate and request the file.
You must generate a new keystore, keyEntry and CSR. You must also specify the same password for the keystore and the keyEntry.
Useful References to understand this issue better.
java.io.IOException: Cannot recover key
Cannot recover
key tomcat
Fish Eye Server Error
Posted by Ans
Pri at Saturday,
November 22, 2014
转载:http://blog.csdn.net/lvron/article/details/7421548
Android开发中,用数字证书签名打包时
第一步: 输入keystore密码 通过
第二步:输入alias密码 不通过时 便会报这个错。
java.security.UnrecoverableKeyException: Cannot recover key
This exception may result from the fact that you had provided a key password that was different from the keystore password
此错误由调用getKey(alias,aliaspassword)函数抛出。
相关文章推荐
- 《Java编程思想》学习笔记5——正则表达式量词匹配
- Myeclipse自动生成注解方式实体类—JPA方式
- Ubuntu12.04 安装jdk
- java-Gson
- websocked
- Java for LeetCode 137 Single Number II
- Java继承中的构造方法
- java-Google Guava
- java基础集合框架——List、Set、Map概述(java集合一)
- NetBeans快捷键大全
- Eclipse Designer根据Activiti项目打包发布bar文件
- java中的属性和字段
- java-java多线程与并发编程专题
- eclipse中一个项目引用另一个项目的方法
- advinst实现Javaweb一键安装部署
- java-java包裹类
- Java自定义注解
- Ubuntu下整合eclipse pydev和virtualenv进行开发
- Java 小型学生管理系统心得
- Java 坦克小游戏心得