Welcome to the Java Programming Forums

The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Proxy authentication

  1. #1
    Junior Member
    Join Date
    Sep 2010
    Thanked 0 Times in 0 Posts

    Unhappy Proxy authentication

    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("", 8080);
            httpclient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy);
            httpclient.getCredentialsProvider().setCredentials(new AuthScope("", 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

  2. #2
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    United Kingdom
    My Mood
    Thanked 293 Times in 226 Posts
    Blog Entries

    Default Re: Proxy authentication

    Please use [highlight=Java] code [/highlight] tags when posting your code.
    Forum Tip: Add to peoples reputation by clicking the button on their useful posts.

  3. #3
    Junior Member
    Join Date
    Sep 2010
    Thanked 0 Times in 0 Posts

    Default Re: Proxy authentication

    hi all thanks .. i have solved my problem

    I used java.net classes in place of httpclient jar

Similar Threads

  1. Replies: 0
    Last Post: January 17th, 2011, 05:14 AM
  2. Authentication system for running/downloading a .jar
    By KiwiProg in forum Java Theory & Questions
    Replies: 1
    Last Post: January 3rd, 2011, 01:29 AM
  3. Authentication problem in a servlet
    By Asido in forum Java Servlet
    Replies: 3
    Last Post: September 17th, 2010, 05:57 AM
  4. get proxy settings from the default system browser
    By reguapo in forum Java Networking
    Replies: 0
    Last Post: January 15th, 2010, 08:43 AM
  5. Replies: 1
    Last Post: July 28th, 2009, 02:15 AM

Tags for this Thread