Как игнорировать исключение «Нет сопоставления альтернативного DNS-имени субъекта» с помощью jaxws-maven-plugin - PullRequest
0 голосов
/ 08 июля 2019

Я пытаюсь запустить wsimport с помощью плагина jaxws-maven-plugin, но получаю следующее:

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)
...