Hi,
I have two doubts :
1. I am trying to connect to some site using URLConnection. But I am behind a proxy. How can I do it to connect to that site? In my code I use the following to cross proxy :
System.getProperties().put( "proxySet", "true" );
System.getProperties().put( "proxyHost", "my proxy ip" );
System.getProperties().put( "proxyPort", "8080" );
String password = "username
assword";
String encodedPassword = "Base " + new sun.misc.BASE64Encoder().encode( password.getBytes() );
URL url = new URL("http://www.rediff.com");
URLConnection urlConnection = url.openConnection();
urlConnection.setRequestProperty( "Proxy-Authorization", encodedPassword );
urlConnection.setDoOutput(true);
But it does not cross the proxy. Am I doing something wrong in the above piece of code ? Any other way to do it ??
2. Is it possible in JDK 1.1 to make a HTTPS connection ? In the above code I tried, but I get error saying that the protocol is not recognised. Is there any way to do it using jdk 1.1 ?
If not then, any new version of jdk supports HTTPS connection ?
Please give your valuable inputs on the same.
Any help in this shall be highly very helpful for me.
Thanks in advance,
Anshumn