cancel
Showing results for 
Search instead for 
Did you mean: 

ssl connection to https server

Former Member
0 Kudos

Hi

I am trying to connect to an https site with java code.

The session starts by exchanging certificates and then by a session cookie.

how do I exchange certificates in the java code?

here is some of the java code i tried to use.

when logging in the site refers me to the login page .

thanks

ofer

Security.addProvider

(new com.sun.net.ssl.internal.ssl.Provider());

KeyStore keystore = KeyStore.getInstance("JKS");

keystore.load

(new FileInputStream

("C:
j2sdk1.4.2_09
jre
lib
security
cacerts"),

"changeit".toCharArray());

SSLContext sc = SSLContext.getInstance("SSL");

sc.init(factory.getKeyManagers(),

trustAllCerts, new java.security.SecureRandom());

HttpsURLConnection.setDefaultSSLSocketFactory(

sc.getSocketFactory());

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi Ofer,

Checkout the link..,

http://help.sap.com/saphelp_nw04/helpdata/en/e2/71c83edf72e16be10000000a114084/content.htm

hope it helps..,

regards,

Vinoth

Answers (0)