Is the Server Response Encrypted?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   ajay_luthria
Posted On:   Wednesday, February 13, 2002 01:30 AM

If I send data over https to an application,how can I receive an encrypted response back from that application and decrypt this response on my side? If I am sending data over https: String sMess = "Hello Java Security"; String uri = "https://myserver/Application" url = new URL(uri); HttpsURLConnection hpCon = (HttpsURLConnection)url.openConnection(); OutputStream output = hpCon.getOutputStream(); output.write(sMess.getBytes()); // Recieve Response in encrypted format and decrypt this. int i; InputStreamReader input = new InputStreamReader(hpCon.getInputStream());    More>>

If I send data over https to an

application,how can I receive an
encrypted response back from that
application and decrypt this response
on my side?

If I am sending data over https:


String sMess = "Hello Java Security";

String uri = "https://myserver/Application"

url = new URL(uri);

HttpsURLConnection hpCon = (HttpsURLConnection)url.openConnection();

OutputStream output = hpCon.getOutputStream();

output.write(sMess.getBytes());


// Recieve Response in encrypted format
and decrypt this.

int i;

InputStreamReader input = new InputStreamReader(hpCon.getInputStream());

while((i = input.read())!=-1)

{

System.out.println((char)i);

}


Now,does the InputStreamReader receive encrypted data and decrypts it transparently?


Please cud any one respond to my query


Ajay
ajayluthria@hotmail.com

   <<Less

Re: Is the Server Response Encrypted?

Posted By:   Paul_Davis  
Posted On:   Wednesday, February 13, 2002 01:48 AM

It's dealt with at the protocol level (ie anything that claims to talk https must be able to en/decrypt data using SSL over an HTTP link) so yup, don't worry - your data will have been decrypted by the time you get it off the stream.
That said, I'm not sure what you're hoping to achieve by writing to the URL output stream in the example above ;-)
About | Sitemap | Contact