dcsimg
Am just a Bit Lost.on https..Please help
3 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   ajay_luthria
Posted On:   Monday, February 18, 2002 01:44 AM

Folks, Do apologize if I am asking this same question over and over. I have written a generic class that sends a message over Https to a Receiving Servlet Now this Servlet sends a response back to the calling class. My doubt is this: 1)Is the response of this servlet to the class over https or http? I am not specifying https in the Servlet application,so I guess that the response is over http,am I right? I want the servlet to send a response over https as the response contains sensitive information. Attached is the class and servlet. Please can some one respond as to what do I need to do to send a secure response ajay    More>>

Folks,

Do apologize if I am asking this same question over and over.
I have written a generic class that sends a message over Https to a Receiving Servlet


Now this Servlet sends a response back
to the calling class.
My doubt is this:

1)Is the response of this servlet to the class over https or http?
I am not specifying https in the Servlet
application,so I guess that the response
is over http,am I right?


I want the servlet to send a response over https as the response contains sensitive information.


Attached is the class and servlet.
Please can some one respond as to what do I need to do to send a secure response

ajay

ajayluthria@hotmail.com




public class HttpsHandler
{

public static String ec(String sMess,String sURL)

String uri = "https://" + sURL + "/server.com/ReceiveResponseServlet";


url = new URL(uri);

hpCon = (HttpsURLConnection)url.openConnection();

DataOutputStream dos = new DataOutputStream(hpCon.getOutputStream());

dos.writeUTF(sMess);


//Receive Response


DataInputStream dis = new DataInputStream(hpCon.getInputStream());


String response = dis.readUTF();



The Servlet:

public void doPost(HttpServletRequest req,
HttpServletResponse res)
throws ServletException, IOException


// Send response back.


System.out.println("Server sending Response Back..." );

DataOutputStream dos = new DataOutputStream(res.getOutputStream());

String sResponse = "Hello Client...This is server sending response ";

dos.writeUTF(sResponse);

Is the response of the server over https or http?
As I am not specifying https,how can the response be over https?or is the response over https?

   <<Less

Re: Am just a Bit Lost.on https..Please help

Posted By:   Paul_Davis  
Posted On:   Tuesday, February 19, 2002 02:20 AM

Request and Response are pairs - two sides of the same communications channel. Hence, if the request side is SSL-encrypted (https), the corresponding response will be sent back encrypted too (unless there's one almighty bug in the servlet engine!!). Likewise, if you request an unencrypted URL (straight http) the response comes back unencrypted.

Re: Am just a Bit Lost.on https..Please help

Posted By:   Fredrik_Andersson  
Posted On:   Tuesday, February 19, 2002 01:19 AM

Hello!



I'm pretty sure that the server will send this back on https cause you read from a input streem that is created upon the hpcon thats uses SSL. But I can't promise this. But I guess you can download a sniffer and look at the traffic before it is decrypted. I guess you can found one at tucows.com.



Please send me an email when you know for sure. fredand44@hotmail.com



Best regards Fredrik Andersson

Re: Am just a Bit Lost.on https..Please help

Posted By:   Fredrik_Andersson  
Posted On:   Tuesday, February 19, 2002 01:19 AM

Hello!



I'm pretty sure that the server will send this back on https cause you read from a input streem that is created upon the hpcon thats uses SSL. But I can't promise this. But I guess you can download a sniffer and look at the traffic before it is decrypted. I guess you can found one at tucows.com.



Please send me an email when you know for sure. fredand44@hotmail.com



Best regards Fredrik Andersson
About | Sitemap | Contact