• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

HTML from HTTPS page

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ?
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Many articles describe how URLConnection and its subclasses can be used with a proxy: Google is your friend
 
Hang a left on main. Then read this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic