我试图使用JAXWS-Maven的插件与wsimport的目标,以创建Web服务客户端,这个POM:Web服务客户端 - SSL证书
<plugin>
<groupId>org.jvnet.jax-ws-commons</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<goals>
<goal>wsimport</goal>
</goals>
</execution>
</executions>
<configuration>
<wsdlUrls>
<wsdlUrl>
https://test.test/WSTtest?wsdl
</wsdlUrl>
</wsdlUrls>
<verbose>true</verbose>
</configuration>
<dependencies>
<dependency>
<groupId>javax.xml</groupId>
<artifactId>webservices-api</artifactId>
<version>1.4</version>
</dependency>
</dependencies>
</plugin>
但我得到的错误
[错误] java.security.cert.CertificateException:没有与IP地址匹配的主题替代名称93.92.169.114 found
因为我需要证书。正如我在SSL client certificate in Maven阅读我在我的POM添加与认证文件的位置相关的propertie:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0-alpha-2</version>
<executions>
<execution>
<goals>
<goal>set-system-properties</goal>
</goals>
<configuration>
<properties>
<property>
<name>javax.net.ssl.trustStore</name>
<value>c:\certificate.crt</value>
</property>
</properties>
</configuration>
</execution>
</executions>
</plugin>
但现在我得到其他错误:
[错误] java.security.NoSuchAlgorithmException:错误构建实现(算法:默认,提供程序:SunJSSE,类:sun.security.ssl.SSLContextImpl $ DefaultSSLContext)
当我在Java Exception on SSLSocket creation中读取时似乎与认证文件的格式有关。我试图通过在POM中添加具有相同结果的属性来指示文件类型。
<properties>
<property>
<name>javax.net.ssl.trustStoreType</name>
<value>JCEKS</value>
</property>
<property>
<name>javax.net.ssl.trustStore</name>
<value>c:\certificate.crt</value>
</property>
</properties>
任何想法我该如何解决这个问题?我做错了什么?这是证明文件在哪里的适当方法吗?
感谢
This answer may help - http://stackoverflow.com/a/6483650/2719186 –