SSL Encryption
This section helps you to use SSL encrypted connections for deployment scenarios. These scenarios require enhanced security. jRemote implements the following connection properties.
SSL Configuration
SSL [Default value: false] Specifies whether the connection should use SSL encryption. SSL should only be used if the jAgent instance running on the jBASE server has also been configured to accept SSL connections.
Java jRemote Clients must set the NaiveTrustManager [Default value: false] property, which forces the Java jRemote Client to trust all server certificates.
#C jRemote Clients should install a valid certificate into the Trusted Root Certification Authorities store. The same certificate created to start jAgent in SSL mode can be used for this purpose. Utilities such as certmgr.exe included in .NET Frameworks can be used to install and manage certificates.
C# jRemote Clients must supply the following property to specify the Common Name (CN) of the Distinguished Name (DN) section in the certificate:
CertificateDN Configuration
You should set the property in the following properties.
try {
DefaultJConnectionFactory cxf = new DefaultJConnectionFactory();
cxf.setHost("127.0.0.1");
cxf.setPort(20002);
cxf.enableSSL(); //Enable SSL encryption
cxf.enableNaiveTrustManager(); //Trust all server credentials
JConnection cx = cxf.getConnection("myUserName", "myPassword");
return cx;
} catch (JRemoteException e) {
// error
}
try {
DefaultJConnectionFactory cxf = new DefaultJConnectionFactory();
cxf.Host = "127.0.0.1";
cxf.Port = 20002;
cxf.EnabledSSL = true; //Enable SSL encryption
cxf.CertificateDN = "MyCompanyName"; //Must match CN attribute in certificate
JConnection cx = cxf.getConnection("myUserName", "myPassword");
return cx;
} catch (JRemoteException e) {
// error
}
Additional Connection Properties
You can also configure the following properties:
- compression [Default value: false] property specifies if the data transferred between client and server should be compressed. Enabling compression yields a better throughput on large data transfers. The opposite effect may occur on small data transfers and therefore jRemote automatically decides if the compression has to be applied based on the supplied threshold value.
- compression_threshold [Default value: 0] property is applicable only if compression is on and defines the threshold used to decide if a certain request is going to be compressed. Data transfers whose size is less than the specified threshold are not compressed. The '0' value specifies that all the data is compressed.
Closing a Connection
After completing with the connection, you should close it to release the associated resources. This process can be done using the cx.close(); command in both the Java and C# platforms.
In this topic