aspose file tools*
The moose likes Security and the fly likes Want to access a secure site data with the use of URL class. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Security
Bookmark "Want to access a secure site data with the use of URL class." Watch "Want to access a secure site data with the use of URL class." New topic
Author

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

lokesh pattajoshi
Ranch Hand

Joined: Jul 29, 2009
Posts: 130
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
Marshal

Joined: Mar 22, 2005
Posts: 42608
    
  65
The client almost never needs a certificate to use SSL. Did you actually encounter a problem while doing this?


Ping & DNS - my free Android networking tools app
lokesh pattajoshi
Ranch Hand

Joined: Jul 29, 2009
Posts: 130
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
Sheriff

Joined: Sep 28, 2004
Posts: 18988
    
  40


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


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
lokesh pattajoshi
Ranch Hand

Joined: Jul 29, 2009
Posts: 130
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

Joined: Jul 29, 2009
Posts: 130
Dittmer sir Kindly help me.
 
jQuery in Action, 2nd edition
 
subject: Want to access a secure site data with the use of URL class.