File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Want to access a secure site data with the use of URL class.

 
lokesh pattajoshi
Ranch Hand
Posts: 130
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everybody,

I want to access data from a secure site(HTTPS) .so my client program will access data securely(with free certificate).can any body please tell me how can i get free certificate and how will i access(through java client programme) the content of that site securely.

Is there any alternate way to retrieve data from a secure site securely without using certificate?

Regards,
Lokesh Kumar Pattajoshi
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The client almost never needs a certificate to use SSL. Did you actually encounter a problem while doing this?
 
lokesh pattajoshi
Ranch Hand
Posts: 130
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dittmer sir thanks for your replay.
No i have not faced any problem while accessing data from https site by disabling SSL(i am using below code for disabling SSL).

TrustManager[] trustAllCerts = new TrustManager[] {

new X509TrustManager(){

public java.security.cert.X509Certificate[] getAcceptedIssuers(){

return null;

}

public void checkClientTrusted( java.security.cert.X509Certificate[] certs, String authType ) { }

public void checkServerTrusted( java.security.cert.X509Certificate[] certs, String authType ) { }

}

};

but i want to access data securely so i need SSL.
 
Henry Wong
author
Marshal
Pie
Posts: 20836
75
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

The code you posted doesn't disable SSL -- the only thing it does is disable the check to see if the certificate is valid. And the only way to make sure it is valid, if you don't want to disable the check, is to register it with a certificate authority.

Other than bypassing the check, everything else related to SSL, ie. encryption, is still in use.

Henry
 
lokesh pattajoshi
Ranch Hand
Posts: 130
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Henry,
Thanks for your replay . I want to share my requirement with you people actually i am giving my request(all the account related details)to PayPal site so after validation they are returning some reference id about transaction(Whether transaction succeed or failed ) so right now i am getting response from PayPal site by disabling certificate(i think by insecure way) but i want to get the response in secure way so is there any way to implement this..? Kindly suggest your response will be highly appreciated.

Thanks and Regards
Lokesh Kumar Pattajoshi
 
lokesh pattajoshi
Ranch Hand
Posts: 130
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dittmer sir Kindly help me.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic