问题描述
我正在尝试在全新的MacBook Pro上设置Tomcat应用程序开发环境。我需要设置实现 org.bouncycastle.jce.provider.BouncyCastleProvider 的SSL连接器。
I am trying to set-up a Tomcat Application development environment on my brand new MacBook Pro. I need to set-up an SSL connector implementing org.bouncycastle.jce.provider.BouncyCastleProvider.
Tomcat 7已启动,但SSL连接器失败要挂载,我在Tomcat Out中读取了此堆栈:
Tomcat 7 starts but the SSL connector fails to be mounted and i read this stack in Tomcat Out :
Grave: Failed to initialize connector [Connector[HTTP/1.1-9443]]
org.apache.catalina.LifecycleException: Failed to initialize component [Connector[HTTP/1.1-9443]]
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:106)
at org.apache.catalina.core.StandardService.initInternal(StandardService.java:559)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:814)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
at org.apache.catalina.startup.Catalina.load(Catalina.java:640)
at org.apache.catalina.startup.Catalina.load(Catalina.java:665)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:281)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455)
Caused by: org.apache.catalina.LifecycleException: L''initialisation du gestionnaire de protocole a échoué
at org.apache.catalina.connector.Connector.initInternal(Connector.java:983)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
... 12 more
Caused by: java.lang.ClassNotFoundException: Error loading SSL Implementation org.bouncycastle.jce.provider.BouncyCastleProvider :java.lang.ClassCastException: org.bouncycastle.jce.provider.BouncyCastleProvider cannot be cast to org.apache.tomcat.util.net.SSLImplementation
at org.apache.tomcat.util.net.SSLImplementation.getInstance(SSLImplementation.java:75)
at org.apache.coyote.http11.AbstractHttp11JsseProtocol.init(AbstractHttp11JsseProtocol.java:118)
at org.apache.catalina.connector.Connector.initInternal(Connector.java:981)
... 13 more
某事告诉我,这与 java.lang.ClassNotFoundException:有关。但是我在JAVA_HOME / lib / ext中找到了包含 org.bouncycastle.jce.provider.BouncyCastleProvider
类的jar。我什至试图将其放置在CATALINA_BASE / lib中,以查看是否可能来自ClassPath错误。否!
Something tells me that it has to do with "java.lang.ClassNotFoundException:". However I located the jar containing org.bouncycastle.jce.provider.BouncyCastleProvider
class in JAVA_HOME/lib/ext. I even tried to place it in CATALINA_BASE/lib in order to see if this could come from a ClassPath error. Nope !
Tomcat server.xml摘录:
Tomcat server.xml excerpt:
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS"
keystoreFile="/Users/xavier/ssl/pchain.keystore"
keystorePass="pwd" />
<Connector port="9443" keystorePass="pwd" alias="pca"
keystoreFile="/Users/xavier/ssl/pca.keystore" keystoreType="BKS"
SSLEnabled="true" clientAuth="false" protocol="HTTP/1.1" scheme="https"
secure="true" sslProtocol="TLS" sslImplementationName="org.bouncycastle.jce.provider.BouncyCastleProvider"/>
这是我的配置信息:
OS X版本10.8.3,
JDK 1.7.0_45,
Tomcat版本7.0.42。
BouncyCastle经过测试的软件包:bcprov-jdk15on-146.jar到bcprov-jdk15on-149.jar
OS X version 10.8.3,JDK 1.7.0_45,Tomcat version 7.0.42.BouncyCastle tested packages : bcprov-jdk15on-146.jar to bcprov-jdk15on-149.jar
有人已经解决了这个问题吗?
Did someone already solve this ?
推荐答案
org.bouncycastle.jce.provider.BouncyCastleProvider
是JCE提供者,但不是JSSE提供者, sslImplementationName
可以预期。
org.bouncycastle.jce.provider.BouncyCastleProvider
is JCE provider, but not JSSE provider, which is expected by sslImplementationName
.
但是,默认的Tomcat的JSSE提供程序在内部使用JCE,因此,如果在JRE中正确配置BouncyCastleProvider,则JSSE提供程序将可以使用其功能。
However, default Tomcat's JSSE provider uses internally JCE, so if you configured BouncyCastleProvider properly in JRE, then its capabilities will be available to JSSE provider.
另外,彻底了解这个问题
的最终目标是什么。
Also it would help to know what is your final goal to answer this questionthoroughly.
这篇关于BouncyCastleProvider在Mac OSX上的Tomcat 7启动时无法加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!