Skip to content

CAUTION: This site hosts draft documentation for the next release. For published content of the latest release, visit www.eclipse.org/openj9/docs

OpenSSL

OpenJDK uses the built-in Java™ cryptographic implementation by default but Eclipse OpenJ9™ also provides some support for the OpenSSL cryptographic library. OpenSSL is an open source cryptographic toolkit for Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols, which is well established and used with many enterprise applications. Because it is a native library, OpenSSL often provides better performance.

OpenSSL is bundled with Eclipse OpenJ9 and is enabled by default. The following algorithms are supported for OpenSSL:

  • AES-CBC cipher
  • AES-GCM cipher
  • ChaCha20 cipher
  • ChaCha20-Poly1305 cipher
  • ECDH key agreement
  • ECDSA signature
  • EC key generation
  • MD5 message digest
  • PBE cipher
  • PBKDF2 secret key factory
  • RSA cipher
  • SHA message digests
  • XDH key agreement
  • XDH key generation

Note: OpenSSL 3.x and later does not support initialization vector (IV) sizes above 16 Bytes for the GCM algorithm. In earlier OpenSSL versions, you can use such sizes but they might cause unpredictable behavior. This should occur only when users are not using the default OpenSSL library that is bundled with Semeru. If you need to use a larger size, disable OpenSSL support for the GCM algorithm.

OpenSSL support is enabled by default for all supported algorithms. If you want to limit support to specific algorithms, a number of system properties are available for tuning the implementation.

Each algorithm can be disabled individually by setting the following system properties on the command line:

You can turn off all the algorithms by setting the following system property on the command line:

-Djdk.nativeCrypto=false

You can set the jdk.native.openssl.skipBundled property to true to skip loading of the OpenSSL libraries that come with OpenJ9. The system will instead attempt to load the libraries from the system path where the libraries are expected to be available. When this value is set to false, the system will attempt to load the pre-packaged OpenSSL libraries. This option cannot be set in conjunction with jdk.native.openssl.lib.

You can use the jdk.native.openssl.lib property to specify user-supplied OpenSSL libraries. This option can be set to a full path name from where you would like to explicitly load the libraries instead of the bundled OpenSSL libraries. This option cannot be set in conjunction with jdk.native.openssl.skipBundled.

To build a version of OpenJDK with OpenJ9 that includes OpenSSL support, follow the steps in the detailed build instructions:

Note: If you obtain an OpenJDK with OpenJ9 build that includes OpenSSL or build a version yourself that includes OpenSSL support, the following acknowledgments apply in accordance with the license terms:

  • This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit. (http://www.openssl.org/).
  • This product includes cryptographic software written by Eric Young (eay@cryptsoft.com).