Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 222
  • Last Modified:

Authenticator firewall problem

Hello,

I'm having trouble getting my program to retrieve URLs from outside of our firewall. I am using this call to the setDefault method :-

   Authenticator.setDefault(new RicksAuthenticator());


Where RicksAuthenticator is this as an inner class :


public class RicksAuthenticator extends Authenticator
{
    protected PasswordAuthentication getPasswordAuthentication()
    {
        // this is my proxy server username/password
        String username = "richard";
        char[] mypass = {'p','a','s,'s','w','o','r','d'};
        return new PasswordAuthentication(username, mypass);
    }  
}    

I then try and get a web page on the internet using java.net.URL but it just times out. When I point it to a page this side of the firewall it works fine.

Is there some way I have to explicitly specify the address/port number of the proxy server so that my program is forced to use it?

Many thanks,

Richard.
0
rick2001
Asked:
rick2001
  • 2
1 Solution
 
SendohCommented:
hi ! think u can try

System.setProperty("http.proxyHost",ipAddressProxyIP);
System.setProperty("http.proxyPort",ipAddressProxyPort);

hope this helps...:P
0
 
rick2001Author Commented:
Perfect!
Many thanks.
0
 
SendohCommented:
no prob...:)
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now