HTTPS connection need guidance

Hi All,

I am a new to java.

I am building a application which calls a web service and gets a response in xml format.I have to read the response and make the decision accordingly.

I don't have clear idea how to develope it?

we are running our application in jsp.

URL to be called (Through http)

https://test.micro.com/test.asmx?op=oip(Web service which is to be called with some parameter)

that should be through the 128 bit verisign certificate.

Should i use HttpsURLConnection.. or some other thing

and How to install certificate etc. How to embade the certificate in connection info so that it can be send from jsp to server.

if any body has some sample code than please send me as early as possible.

URL myurl = new URL("https://conwayXMLURL");

HttpsURLConnection myConnection = (HttpsURLConnection)myurl.openConnection();

// Setup connection parameters

myConnection.setRequestMethod("POST");

myConnection.setDoOutput(true);

myConnection.setDoInput(true);

myConnection.setUseCaches(false);

// Set the headers correctly (URL encoding, authentication)

myConnection.setRequestProperty("Content-type", "application/x-www-form-urlencoded");

myConnection.setRequestProperty("anand", "auth");

Is this the correct way opf doing? or some other approach i have to follow.

How to set parameter and certificate in this request.(If this approach is OK)

Please send me the sample code if possible.

Regards,

madhvi

[1563 byte] By [anand123a] at [2007-10-1 7:15:47]
# 1

If you utilize the HttpsURLConnection you would not have to worry about handling the handshake protocol of SSL, just communicate as though you are using HttpURLConnection.

You would need to have an implementation of JSSE, and should have setup JSSE properly for this to work. To change the defaults of HttpsURLConnection

use .setSSLSocketFactory to set the socket factory to get the connection from

anandrajasekara at 2007-7-9 18:23:38 > top of Java-index,Security,Java Secure Socket Extension (JSSE)...