开发者

Failed to generate a proxy class for Exchange EWS: unable to find valid certification path to requested target

开发者 https://www.devze.com 2023-02-05 10:42 出处:网络
开发者_运维知识库I want to generate a proxy class for EWS (http://msdn.microsoft.com/en-us/library/dd877045%28v=exchg.140%29.aspx).
开发者_运维知识库

I want to generate a proxy class for EWS (http://msdn.microsoft.com/en-us/library/dd877045%28v=exchg.140%29.aspx).

keytool -keystore t:\my.keystore -storepass password -import -trustcacerts -alias MY-CA -file t:\MY-CA.crt
keytool -keystore t:\my.keystore -storepass password -list
set VMARGS=-Djavax.net.debug=all
set VMARGS=%VMARGS% -Djavax.net.ssl.trustStore=t:\my.keystore -Djavax.net.ssl.trustStorePassword=password
wsimport https://mail.xxxx.co.jp/ews/Exchange.asmx

But I get this error message:

[ERROR]
sun.security.validator.ValidatorException:
PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException:
unable to find valid certification path to requested target


Try:

wsimport -Djavax.net.ssl.trustStore=t:\my.keystore https://mail.xxxx.co.jp/ews/Exchange.asmx

It would appear that VMARGS is not being picked up by wsimport.

If the above works then proof conclusive. Otherwise the issue is either you have the wrong RootCA added to your keystore or the keystore is not being read


I can confirm this is still an problem for JDK1.6.0u29

When running the following command:

wsimport -Djavax.net.ssl.trustStore=c:\jdk160_29\.mykeystore https://url.com?wsdl -p com.test -s ./src

I got the following error:

unrecognized parameter -Djavax.net.ssl.trustStore=c:\jdk160_29\.mykeystore

But I found a workaround to execute the following command:

java -Djavax.net.ssl.trustStore=c:\jdk160_29\.mykeystore -classpath C:\jdk160_29\lib\tools.jar com.sun.tools.internal.ws.WsImport https://ur.com?wsdl -p com.test -s ./src
0

精彩评论

暂无评论...
验证码 换一张
取 消