我正在尝试使用jaxws-maven-plugin插件运行wsimport,但是我得到了:
Exception: javax.net.ssl.SSLHandshakeException: java.security.cert.Certifica
teException: No subject alternative DNS name matching...
服务器具有正版证书,但证书不包含其域名。
插件配置具有一个xdisableSSLHostnameVerification
属性,我认为应该禁用该异常。该证书已导入到JDK cacerts文件中。
<configuration>
<args>
<arg>-B-XautoNameResolution</arg>
</args>
<vmArgs>
<vmArg>-Djavax.xml.accessExternalDTD=all</vmArg>
<vmArg>-Djavax.xml.accessExternalSchema=all</vmArg>
<vmArg>-Dcom.sun.jndi.ldap.object.disableEndpointIdentification=true</vmArg>
<vmArg>-Dcom.sun.net.ssl.checkRevocation=false</vmArg>
<vmArg>-Djdk.tls.trustNameService=true</vmArg>
</vmArgs>
<xdebug>true</xdebug>
<xdisableSSLHostnameVerification>true</xdisableSSLHostnameVerification>
<useJdkToolchainExecutable>true</useJdkToolchainExecutable>
[INFO] jaxws:wsimport args: [-keep, -s, 'C:target\generated-sources\wsimport', -d, 'C:tar
get\classes', -Xnocompile, -B-XautoNameResolution, -Xdebug, -XdisableSSLHostnameVerification, -b, 'file:/C:/src/main/resources/binding.xml', "https:/
/hostname:10052/?WSDL"]
[DEBUG] Authorization file "C:\Users\jcoleman\.metro\auth" not found. If the WSDL access needs Basic Authentication, please provide authorization file with read access at C:\Users\jcoleman\.metro\auth or use
-Xauthfile to give the authorization file and on each line provide authorization information using this format : http[s]://user:password@host:port//<url-path>
...
com.sun.istack.SAXParseException2; IOException thrown when processing "https://hostname:10052/?xsd=xsd0". Exception: javax.net.ssl.SSLHandshakeException: java.security.cert.Certifica
teException: No subject alternative DNS name matching hostname found..
at com.sun.tools.xjc.ErrorReceiver.error(ErrorReceiver.java:94)