The Authenticator method isn't working for me, using JDK 1.3.1_06 and JSSE 1.0.3_01. I still get the 407 error. My code works just fine under 1.4.1, however.

Is there a way to make it work under 1.3.1. Are other people having these problems with it?

Here's my code:
// get proxy and port from command line
SecureClient.proxyhost = args[2]; //
SecureClient.proxyport = args[3]; //


// set the JSSE system properties
System.setProperty("https.proxyHost", SecureClient.proxyhost);
System.setProperty("https.proxyPort", SecureClient.proxyport);


System.out.println("using proxy: "+ SecureClient.proxyhost + " port " + SecureClient.proxyport);


// now create http authentication


// this didn't work
// System.setProperty("http.proxyUser", "myuser");
// System.setProperty("http.proxyPassword", "mypassword");


// this worked in 1.4.1
Authenticator.setDefault( new httpAuthenticateProxy() );
..........................................

and here's my authenticator class:

public class httpAuthenticateProxy extends Authenticator {

protected PasswordAuthentication getPasswordAuthentication() {
// username, password
// sets http authentication
return new PasswordAuthentication("myuser","mypassword".toCharArray());
}

}
.............................................

相关文章:

  • 2022-01-07
  • 2021-10-05
  • 2022-02-08
  • 2022-01-04
  • 2021-12-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-10-02
  • 2022-12-23
  • 2021-11-21
  • 2021-09-29
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案