Hi all
I am using HttpClient 4.0.3 Api for proxy authentication,i am getting the following exception, can some one plz help me in this.
Exception in thread "main" javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
at com.sun.net.ssl.internal.ssl.SSLSessionImpl.getPee rCertificates(Unknown Source)
at org.apache.http.conn.ssl.AbstractVerifier.verify(A bstractVerifier.java:128)
at org.apache.http.conn.ssl.SSLSocketFactory.createSo cket(SSLSocketFactory.java:399)
at org.apache.http.impl.conn.DefaultClientConnectionO perator.updateSecureConnection(DefaultClientConnec tionOperator.java:203)
at org.apache.http.impl.conn.AbstractPoolEntry.layerP rotocol(AbstractPoolEntry.java:277)
at org.apache.http.impl.conn.AbstractPooledConnAdapte r.layerProtocol(AbstractPooledConnAdapter.java:138 )
at org.apache.http.impl.client.DefaultRequestDirector .establishRoute(DefaultRequestDirector.java:704)
at org.apache.http.impl.client.DefaultRequestDirector .execute(DefaultRequestDirector.java:421)
at org.apache.http.impl.client.AbstractHttpClient.exe cute(AbstractHttpClient.java:641)
at org.apache.http.impl.client.AbstractHttpClient.exe cute(AbstractHttpClient.java:597)
below is the code i am using
DefaultHttpClient httpclient = new DefaultHttpClient(); HttpHost proxy = new HttpHost("127.0.0.1", 8080); httpclient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy); httpclient.getCredentialsProvider().setCredentials(new AuthScope("127.0.0.1", 8080),new UsernamePasswordCredentials("username", "password")); HttpHost targetHost = new HttpHost("infinity.icicibank.co.in/BANKAWAY?Action.RetUser.Init.001=Y&AppSignonBankId=ICI&AppType=corporate&abrdPrf=N", 443, "https"); //HttpHost targetHost = new HttpHost("www.gmail.com", 80, "http"); HttpGet httpget = new HttpGet("/"); System.out.println("executing request: " + httpget.getRequestLine()); System.out.println("via proxy: " + proxy); System.out.println("to target: " + targetHost); HttpResponse response = httpclient.execute(targetHost, httpget); HttpEntity entity = response.getEntity();
and can anyone sugest some good tutorials for solving above problem