问题描述
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
at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1937)
at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:302)
at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:296)
at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1478)
这是我们的代码-
URL urlAuthToken = new URL("https://test.api.amadeus.com/v1/security/oauth2/token");
httpsConAuthToken = (HttpsURLConnection) urlAuthToken.openConnection();
httpsConAuthToken.setRequestMethod("POST");
httpsConAuthToken.setRequestProperty("Cache-Control","no-cache");
httpsConAuthToken.setRequestProperty(
"Content-Type","application/x-www-form-urlencoded");
httpsConAuthToken.setDoInput(true);
httpsConAuthToken.setDoOutput(true);
String paramsToPassAuthToken = "grant_type=client_credentials&client_id={api key}&client_secret={secret}";
DataOutputStream wr = new DataOutputStream (
httpsConAuthToken.getoutputStream ());
wr.writeBytes(paramsToPassAuthToken);
wr.flush();
wr.close();
请让我知道如何解决此问题。感谢您的帮助。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)