Skip to Content
0
Former Member
Jun 15, 2007 at 08:32 AM

DC Usages for JAVA SSL Client

29 Views

Hello,

I am currently struggling on implementing a java client, that is able to call an url via HTTPS.

HTTP URL calls are working fine, but HTTPs is not working.

I found already the piece of code, whis is missing, but I cannot implement until I have found the DCs from SAP_JEE or SAP_JTECHS, which contain the following classes.

- SecureConnectionFactory

- KeystoreManager

My piece of code for SSL Support:

			// setup connection
			serverURL = ApplicationProperties.getProperty("partminer.url.request");
			if (null != serverURL && serverURL.startsWith("https")) {
				InitialContext ctx = ctx = new InitialContext();
				Object o = (Object) ctx.lookup("keystore");
				KeystoreManager manager = (KeystoreManager) o;
				KeyStore keyStore = manager.getKeystore("DEFAULT");
				// Create factory
				SecureConnectionFactory factory = new SecureConnectionFactory(keyStore, null);
				// Create the HTTPS connection
				con = factory.createURLConnection(serverURL);
			} else {
				URL url = new URL(serverURL);
				con = (HttpURLConnection) url.openConnection();
			}

Can anyone please let me know, which DC are to be used by my java client DC ?

Thank you,

Stefan