配置tomcat连接器后,启动服务报错“No Certificate file specified or invalid file format"异常

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了配置tomcat连接器后,启动服务报错“No Certificate file specified or invalid file format"异常相关的知识,希望对你有一定的参考价值。

1:原来的配置是

1 <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
2                maxThreads="150" scheme="https" secure="true"
3                clientAuth="false" sslProtocol="TLS" keystoreFile="conf/.keystore" keystorePass="123456"/>

 

2:保存配置,启动服务器,报如下异常:

java.lang.Exception: No Certificate file specified or invalid file format
at org.apache.tomcat.jni.SSLContext.setCertificate(Native Method)
at org.apache.tomcat.util.net.AprEndpoint.init(AprEndpoint.java:835)
at org.apache.coyote.http11.Http11AprProtocol.init(Http11AprProtocol.java:109)
at org.apache.catalina.connector.Connector.initialize(Connector.java:1141)
at org.apache.catalina.core.StandardService.initialize(StandardService.java:703)
at org.apache.catalina.core.StandardServer.initialize(StandardServer.java:843)
at org.apache.catalina.startup.Catalina.load(Catalina.java:538)
at org.apache.catalina.startup.Catalina.load(Catalina.java:562)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:261)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)

 

原因:tomcat版本问题,我用的是tomcat6_45版本,默认使用apr协议,解决办法:

配置修改为:

1   <Connector port="8443" protocol="org.apache.coyote.http11.Http11Protocol" SSLEnabled="true"
2                maxThreads="150" scheme="https" secure="true"
3                clientAuth="false" sslProtocol="TLS" keystoreFile="conf/.keystore" keystorePass="123456"/>

再次重启服务器,就没有问题了。

以上是关于配置tomcat连接器后,启动服务报错“No Certificate file specified or invalid file format"异常的主要内容,如果未能解决你的问题,请参考以下文章

启动Spring后,连接mysql报错

spring mvc配置方法解释器后,启动Tomcat报错!

启动tomcat服务器JDBC报错

Tomcat启动时org.apache.catalina.startup.VersionLoggerListener报错

tomcat正常启动后http://localhost:8080/报错404

Servlet学习之Tomcat secretRequired配置报错问题