简体   繁体   English

SSLHandshakeException动态Web项目Java

[英]SSLHandshakeException dynamic web project java

In my Wicket application I would like to send data to a wsdl-endpoint with soap. 在我的Wicket应用程序中,我想用肥皂将数据发送到wsdl端点。 To accomplish this, I made a dynamic web project in Eclipse (with Axis2). 为此,我在Eclipse中(使用Axis2)创建了一个动态Web项目。 I get an error while connecting to the endpoint. 连接到端点时出现错误。 The error is: 错误是:

Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target 引起原因:javax.net.ssl.SSLHandshakeException:sun.security.validator.ValidatorException:PKIX路径构建失败:sun.security.provider.certpath.SunCertPathBuilderException:无法找到到请求目标的有效证书路径

The endpoint expects a username and password, with a preemptive connection. 端点需要用户名和密码,并具有抢先连接。

This is my code: 这是我的代码:

Deliver deliver = new Deliver();

XmlDataList dataList = new XmlDataList();
dataList.addXmlData(XML);   
deliver.setXmlDataList(dataList);
Stubstub = new Stub();

Authenticator basicAuthenticator = new HttpTransportProperties.Authenticator();
List<String> schemes= new ArrayList<String>();
authSchemes.add(Authenticator.BASIC);
basicAuthenticator.setAuthSchemes(schemes); 
basicAuthenticator.setUsername("UName");
basicAuthenticator.setPassword("Pwd");
basicAuthenticator.setPreemptiveAuthentication(true);

stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.AUTHENTICATE, basicAuthenticator);

How can I set the preemptive conditions for connecting to a wsdl (https)? 如何设置连接到wsdl(https)的抢占条件? Can someone explain to me how this works? 有人可以向我解释这是如何工作的吗?

Thanks! 谢谢!

The error message means that your endpoint uses a probably self-signed certificate. 该错误消息表示您的端点使用的可能是自签名证书。 You have to add this certificate to your local keystore in order to accept it. 您必须将此证书添加到本地密钥库中才能接受。 See the following question: Resolving javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed Error? 请参见以下问题: 解决javax.net.ssl.SSLHandshakeException:sun.security.validator.ValidatorException:PKIX路径构建失败错误?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM