keystore password was incorrect
一、问题由来
最近在部署后台系统项目的时候,希望给项目增加一些安全措施,在项目中添加了SSL证书,可是在自己添加完该证书后,测试启动项目立马报错。
报错信息如下:
org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat server
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.start(TomcatWebServer.java:215)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.startWebServer(ServletWebServerApplicationContext.java:297)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:163)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:553)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215)
at com.kaishun.study.WebBackendApplication.main(WebBackendApplication.java:20)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
Caused by: java.lang.IllegalArgumentException: standardService.connector.startFailed
at org.apache.catalina.core.StandardService.addConnector(StandardService.java:231)
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.addPreviouslyRemovedConnectors(TomcatWebServer.java:278)
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.start(TomcatWebServer.java:197)
... 15 common frames omitted
Caused by: org.apache.catalina.LifecycleException: Protocol handler start failed
at org.apache.catalina.connector.Connector.startInternal(Connector.java:1008)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.addConnector(StandardService.java:227)
... 17 common frames omitted
Caused by: java.lang.IllegalArgumentException: keystore password was incorrect
at org.apache.tomcat.util.net.AbstractJsseEndpoint.createSSLContext(AbstractJsseEndpoint.java:99)
at org.apache.tomcat.util.net.AbstractJsseEndpoint.initialiseSsl(AbstractJsseEndpoint.java:71)
at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:217)
at org.apache.tomcat.util.net.AbstractEndpoint.bindWithCleanup(AbstractEndpoint.java:1141)
at org.apache.tomcat.util.net.AbstractEndpoint.start(AbstractEndpoint.java:1227)
at org.apache.coyote.AbstractProtocol.start(AbstractProtocol.java:586)
at org.apache.catalina.connector.Connector.startInternal(Connector.java:1005)
... 19 common frames omitted
Caused by: java.io.IOException: keystore password was incorrect
at sun.security.pkcs12.PKCS12KeyStore.engineLoad(PKCS12KeyStore.java:2015)
at java.security.KeyStore.load(KeyStore.java:1445)
at org.apache.tomcat.util.security.KeyStoreUtil.load(KeyStoreUtil.java:67)
at org.apache.tomcat.util.net.SSLUtilBase.getStore(SSLUtilBase.java:217)
at org.apache.tomcat.util.net.SSLHostConfigCertificate.getCertificateKeystore(SSLHostConfigCertificate.java:206)
at org.apache.tomcat.util.net.SSLUtilBase.getKeyManagers(SSLUtilBase.java:283)
at org.apache.tomcat.util.net.SSLUtilBase.createSSLContext(SSLUtilBase.java:247)
at org.apache.tomcat.util.net.AbstractJsseEndpoint.createSSLContext(AbstractJsseEndpoint.java:97)
... 25 common frames omitted
Caused by: java.security.UnrecoverableKeyException: failed to decrypt safe contents entry: javax.crypto.BadPaddingException: Given final block not properly padded
... 33 common frames omitted
大致意思是说服务器不能正常启动,keystore 的密码无效。
二、问题分析
这个是配置信息

对于这个错误信息感到一头雾水,之前也是使用这种配置方式来进行配置的,怎么突然就不行了呢,让我很是意外。自己也反复的回想
自己在这当中进行的一些操作,第一次部署SSL证书时,是直接从阿里云官网上面下载下来的,密码和证书是成对出现的。我第二次配置
这个证书的时候,也是从阿里元官网上面下载的,密码是使用新的,可是pfx证书却是从之前那个项目当中拷贝过来的。因为密码全部做了加密操作,
忘记了之前的密码,才使用最新下载的SSL证书的密码,证书确是使用旧有的。

分析到这里,自己也知道出问题的原因了。我立马又去阿里云重新下载了一个tomcat的SSL证书,发现密码又变了。因此确定这个问题的原因
所在,每次下载阿里云的SSL证书时,pfx证书和密码都是成对出现的,不能混用。
三、解决方案
搞清楚问题的原因之后,我立马进行修改,使用正确的、配对的证书,重新启动项目,出现新问题。
jsse.alias_no_key_entry
我倒回去查看之前的配置信息,发现最新项目的配置中多了一行配置,立马删除。

重新启动项目,正常启动,问题解决。
keystore password was incorrect的更多相关文章
- Java导入证书失败Keystore was tampered with, or password was incorrect
keytool 错误: java.io.IOException: Keystore was tampered with, or password was incorrect 在进行证书相关操作, ...
- android 签名被篡改(Keystore was tampered with, or password was incorrect)
在配置自定义签名时出现了"Keystore was tampered with, or password was incorrect"错误! 参考文档发现: If necessar ...
- 解决Keystore was tampered with, or password was incorrect
使用签名文件keystore查看生成的数字签名中报错解决 Keystore was tampered with, or password was incorrect 这是由于android规定自己定义 ...
- mongodb 安装遇到问题:the domain,user name and/or password are incorrect.remember to use"." for the domain if the account is on the local machine
安装mongoDB遇到如下问题:the domain,user name and/or password are incorrect.remember to use"." for ...
- Keystore was tampered with, or password was incorrect
#修改key条目密码 # keytool -keypasswd -alias test.com -keypass oldkeypwd -new newkeypwd -storepass storepw ...
- win10安装MongoDB提示 the domain,user name and/or password are incorrect. Remember to use "." for the domain if the account is on the local machine.
好心塞,提示输入不合法. 后来发现这样可以解决.退出安装.重新打开()因为我第一次打开时是没有卡在这一步的,只不过返回上一页时就一直卡在验证的页面了),默认,默认,默认,
- Eureka【启用https】
上一篇主要说的是开启http basic认证,从安全角度来讲,基于base64编码,容易被抓包后破解,在公网中很不安全,本文详谈如何在eureka server和eureka client中开启htt ...
- 【转】eclipse android 设置及修改生成apk的签名文件 -- custom debug keystore
原文网址:http://hold-on.iteye.com/blog/2064642 android eclipse 设置及修改生成apk的签名文件 1. 问题: 平时在使用eclipse进行andr ...
- Eclipse ADT的Custom debug keystore所需证书规格
最近开始研究Google Play的In-app Billing IAB内置计费API,发现一个比较烦人的问题就是测试时应用必须经过正式签名,而默认Eclipse ADT调试运行使用的是临时生成的De ...
随机推荐
- 关于servlet中doGet和doPost乱码再一次理解
今天系统的整理了在web项目下,出现的编码问题,下面就做一些总结: 首先对HTTP协议中对GET和POST的定义: GET POST 后退按钮/刷新 无害 数据会被重新提交(浏览器应该告知用户数据 ...
- 轻量级日志收集方案Loki
先看看结果有多轻量吧 官方文档:https://grafana.com/docs/loki/latest/ 简介 Grafana Loki 是一个日志聚合工具,它是功能齐全的日志堆栈的核心. Loki ...
- ArrayList线程不安全怎么办?(CopyOnWriteArrayList详解)
ArrayList线程不安全怎么办? 有三种解决方法: 使用对应的 Vector 类,这个类中的所有方法都加上了 synchronized 关键字 就和 HashMap 和 HashTable 的关系 ...
- Supervisor服务开机自启动
要解决的问题 在机器上部署自己编写的服务时候,我们可以使用Supervisor作为进程检活工具,用来自动重启服务. 但是当机器重启后,Supervisor却不能自动重启,那么谁来解决这个问题呢? 答案 ...
- 带你走进MySQL全新高可用解决方案-MGR
一.初识MGR 相信很多人对MGR这个词比较陌生,其实MGR(全称 MySQL Group Replication [MySQL 组复制])是Oracle MySQL于2016年12月发布MySQL ...
- 配置双jdk
1 CLASSPATH:.%JAVA_HOME%\lib;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar 2 JAVA_HOME:%JAVA_HOME ...
- Ubuntu下 QT中配置ROS-Kinetic
打开qtcreater自动加载ros环境,通过修改*.desktop文件 gedit ~/.local/share/applications/qtcreator.desktop 将其中Exec=XXX ...
- BUU-CTF[CISCN2019 华东南赛区]Web11
BUU-CTF[CISCN2019 华东南赛区]Web11 页面最下端有提示Build with Smarty ! 确定页面使用的是Smarty模板引擎.输入{$smarty.version}就可以看 ...
- 快速入门PaddleOCR,并试用其开发一个搜题小工具
介绍 PaddleOCR 是一个基于百度飞桨的OCR工具库,包含总模型仅8.6M的超轻量级中文OCR,单模型支持中英文数字组合识别.竖排文本识别.长文本识别.同时支持多种文本检测.文本识别的训练算法. ...
- vue 打开新窗口进行打印
父文件 let { href } = this.$router.resolve({ path: ' 自己配置本地路由,不需要动态路由 ', query: 个人建议传一整个对象 }) window.op ...