Chapter 15. Securing the EJB RMI transport layer
This chapter describes configuration of two different arrangements for Remote Method Invocation of EJB3s over an encrypted transport: RMI + SSL and RMI via HTTPS. HTTPS is an option as the transport for RMI when firewall configuration prevents use of the RMI ports.
15.1. SSL Encryption overview
15.1.1. Key pairs and Certificates
Public Key Infrastructure relies on a chain of trust to establish the credentials of unknown machines. The use of public keys not only encrypts traffic between machines, but also functions to establish the identity of the machine at the other end of a network connection. A "Web of Trust" is used to verify the identity of servers. A server may be unknown to you, but if its public key is signed by someone that you trust, you extend that trust to the server. Certificate Authorities are commercial entities who verify the identity of customers and issue them signed certificates. The JDK includes a cacerts
file with the certificates of several trusted Certificate Authorities (CAs). Any keys signed by these CAs are automatically trusted. Large organizations may have their own internal Certificate Authority, for example using Red Hat Certificate System. In this case the signing certificate of the internal Certificate Authority is typically installed on clients as part of a Corporate Standard Build, and then all certificates signed with that certificate are trusted. CA-signed certificates are best practice for production scenarios.
cacerts
file of clients, you need to export a certificate for that key on the server, and import that certificate on any client that connects via SSL.
keytool
, a command line tool for generating key pairs and certificates. The certificates generated by keytool
can be sent for signing by a CA or can be distributed to clients as a self-signed certificate.
- Generating a self-signed certificate for development use and importing that certificate to a client is described in Section 15.2.1, “Generate a self-signed certificate with keytool” .
- Generating a certificate and having it signed by a CA for production use is beyond the scope of this edition. Refer to the man page for keytool for further information on performing this task.