• Post Reply Bookmark Topic Watch Topic
  • New Topic

HTML from HTTPS page  RSS feed

 
An Raj
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I am trying to get the HTML source for a HTTPS page.

The foll. is my code and the prompt is as foll.
Prompt> java ReadHttpsURL3 https://www.sun.com
( But I get run time error -
Exception in thread "main" java.net.ConnectException: Connection timed out: conect ..... at ReadHttpsURL3.main(ReadHttpsURL3.java:10))

Thanks!
---------------------------code----------------------------------

--------------------------------------------------------------
[ August 14, 2006: Message edited by: Carl Trusiak ]
 
Carl Trusiak
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try running :

java ReadHttpsURL3 https://www.paypal.com

See how that works
 
An Raj
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I tried https://www.paypal.com/

But I get the same error as before. Am I missing some thing?

I am working with java 1.5.0_07
May be I need a new one that has javax.net.ssl ?
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
javax.net.ssl has been in the JDK for a while, so your version is OK. Do you have a direct connection, or do you maybe need to set up a proxy? Can you make HTTP connections?
 
An Raj
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks!

I did go over trying to connect to regular URL.

I used
URL google = new URL("http://www.google.com/");
URLConnection gl = google.openConnection();

And it did not work.

I was giving me an error at "google.openConnection()"

So, then I used my local web site at work and it worked fine.

So the problem is probably due to the openConnection() method.
Do I have to use openConnection(Proxy proxy) ?
And how do I get the proxy information?

Thanks again for all the help and guidance.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Many articles describe how URLConnection and its subclasses can be used with a proxy: Google is your friend
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!