You can set up a secure P4 communication using both SSL and HTTPS protocols as underlying transport layers.
You have configured your AS Java to use SSL. More information: Configuring the Use of SSL on the AS Java.
You have configured the port for secure connections on the ICM for AS Java. Then, the client uses that port to open the secure connection in its request to the AS Java.
More information: Managing the Underlying Transport Layers.
In your client code, obtain the InitialContext to connect to the remote object using the following properties:
Specify the port for the secure connection with the provider URL property.
Specify the underlying transport layer you want to use. You use the TransportLayerQueue property with value SSL for P4 over an SSL connection, or HTTPS for P4 over an HTTPS connection.
The following example shows client code that obtains InitialContext using a specific transport layer. This transport layer (SSL or HTTPS) is specified by the transportType parameter provided in the command line when the following client code is executed:
Syntax
public void init(String host, String port, String user, String pass, String transportType) { try { Properties p = new Properties(); p.put("java.naming.factory.initial", "com.sap.engine.services.jndi.InitialContextFactoryImpl"); p.put("java.naming.provider.url", host + ":" + port); p.put("java.naming.security.principal", user); p.put("java.naming.security.credentials", pass); // The transportType parameter has value ssl or https. // It is provided on the command line. p.put("TransportLayerQueue", transportType); InitialContext ctx = new InitialContext(p); System.out.println("NamingClient.run1 ctx : " + ctx); } catch(javax.naming.NamingException e) { System.out.println(">> Exception : " + e.getMessage()); e.printStackTrace(); } }