Axis2使用蜻蜓信任库

在我的Wildfly 10.0.0.Final上激活的后台进程需要使用Axis连接到webservice。 在远程服务器上,有一个自签名证书,我使用openssl将其导入信任库以从远程服务器获取它,并使用keytool创build信任库并将证书导入到该信任库中。

我设置了我的Wildfly 10.0.0.Final的standalone.xml,像这样:

<security-realm name="SSLRealm"> <server-identities> <ssl> <keystore path="keystore.jks" relative-to="jboss.server.config.dir" keystore-password="mykeystorepassword" alias="myalias" key-password="mykeypass" /> </ssl> </server-identities> <authentication> <truststore path="truststore.jks" relative-to="jboss.server.config.dir" keystore-password="mytruststorepassword" /> </authentication> </security-realm> <server name="default-server"> <http-listener name="default" socket-binding="http" redirect-socket="https" /> <https-listener name="default-ssl" security-realm="SSLRealm" socket-binding="https" /> <host name="default-host" alias="localhost"> <location name="/" handler="welcome-content" /> </host> </server> 

但是,当后台进程试图连接到远程服务时,我得到以下exception:

 Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target at sun.security.provider.certpath.SunCertPathBuilder.build(Unknown Source) at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown Source) at java.security.cert.CertPathBuilder.build(Unknown Source) 

任何想法如何解决这个问题? 好像信任库没有被使用或者像这样的东西…