• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Authenticator Class

 
Abhijt Rao
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi i have this piece of code for conecting to authenticated proxy in my class
static class MyAuthenticator extends Authenticator {

MyAuthenticator() {
}

protected PasswordAuthentication getPasswordAuthentication() {
System.out.println("PasswordAuthentication ");
return new PasswordAuthentication(
System.getProperty("sonic.http.proxyUsername"), System.getProperty("sonic.http.proxyPassword").toCharArray());
}

}

and I also do

MyAuthenticator myAuth = new MyAuthenticator();

Authenticator.setDefault(myAuth);

This code works absolutely fine in j2sdk1.4 and the getpasswordAuthentication method is called but in jdk1.5 (i am using jdk1.5.0_13) this method doesnt get called at all

Do i need to do something differently for 1.5?
 
Joe Ess
Bartender
Posts: 9313
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the JavaRanch.
You must have missed our naming policy on the way in. In short, your displayed name must be your real (or at least real-sounding) first and last name separated by a space. You can change your displayed name here.
 
Abhijt Rao
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

These are my connection parameters

https.proxyHost=
https.proxyPort=
sonic.https.useAnyHostnameVerifier=true
sonic.https.proxyAuthentication=true
sonic.http.proxyUsername=
sonic.http.proxyPassword=
javax.net.ssl.trustStore=<set to my certs directory>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic