Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

ssl connection to https server

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());

Former Member
Former Member replied

hi Ofer,

Checkout the link..,

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

hope it helps..,

regards,

Vinoth

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question