Hi, I talked with a colleague of mine and he said that you may need to install the certificate in your keystore to work around this error. He pointed me to the following information which should help:
http://www.java-samples.com/showtutorial.php?tutorialid=210 Best, - Eric Koleda, AdWords API Team On Apr 8, 6:28 pm, J <[email protected]> wrote: > Hello, > > I am trying to make a call to ClientLogin using the following code and > getting error related to certification path. > > Code: > > String data = > "accountType=GOOGLE&Email=test&Passwd=test&service=adwords&source=something "; > URL url = new URL("https://www.google.com/accounts/ > ClientLogin"); > HttpURLConnection conn = > (HttpURLConnection)url.openConnection(); > conn.setRequestMethod("POST"); > conn.setDoOutput(true); > conn.setDoInput(true); > conn.setUseCaches(false); > conn.setRequestProperty("Content-Type", > "application/x-www-form-urlencoded"); > OutputStreamWriter wr = new > OutputStreamWriter(conn.getOutputStream()); > wr.write(data); > wr.close(); > > System.out.println(conn.getResponseMessage()); > > BufferedReader rd = new BufferedReader(new > InputStreamReader(conn.getInputStream())); > String line; > while ((line = rd.readLine()) != null) { > System.out.println("line: " + line); > } > > } > > Error: > > Exception in thread "main" 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 com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java: > 174) > at > com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java: > 1591) > at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java: > 187) > at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java: > 181) > at > com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHands > haker.java: > 1035) > at > com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHandshak > er.java: > 124) > at > com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Handshaker.java: > 516) > at > com.sun.net.ssl.internal.ssl.Handshaker.process_record(Handshaker.java: > 454) > at > com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java: > 884) > at > com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocke > tImpl.java: > 1096) > at > com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.jav a: > 1123) > at > com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.jav a: > 1107) > at > sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java: > 415) > at > sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Abstrac... > 166) > at > sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection... > 881) > at > sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLCon... > 230) > at > oracle.apps.marketing.searchMarketing.ui.bean.MktSearchMarketing.main(MktSe > archMarketing.java: > 497) > Caused by: 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.validator.PKIXValidator.doBuild(PKIXValidator.java: > 285) > at > sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java: > 191) > at sun.security.validator.Validator.validate(Validator.java:218) > at > com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.validate(X509TrustManager > Impl.java: > 126) > at > com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(X509Tr > ustManagerImpl.java: > 209) > at > com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(X509Tr > ustManagerImpl.java: > 249) > at > com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHands > haker.java: > 1014) > ... 12 more > Caused by: sun.security.provider.certpath.SunCertPathBuilderException: > unable to find valid certification path to requested target > at > sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBu > ilder.java: > 174) > at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:238) > at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java: > 280) > ... 18 more > Process exited with exit code 1. > > -- > =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ > Have you migrated to v200909 yet? > The v13 sunset is on April 22, 2010. > > Also find us on our blog and discussion > group:http://adwordsapi.blogspot.comhttp://groups.google.com/group/adwords-api > =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ > > You received this message because you are subscribed to the Google > Groups "AdWords API Forum" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group > athttp://groups.google.com/group/adwords-api?hl=en -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Have you migrated to v200909 yet? The v13 sunset is on April 22, 2010. Also find us on our blog and discussion group: http://adwordsapi.blogspot.com http://groups.google.com/group/adwords-api =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ You received this message because you are subscribed to the Google Groups "AdWords API Forum" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/adwords-api?hl=en To unsubscribe, reply using "remove me" as the subject.
