| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
JRuby-OpenSSL is an extension gem for JRuby that emulates the Ruby OpenSSL native library.
Under the hood it uses the Bouncy Castle Crypto APIs.
All jruby-openssl gem releases include the Bouncy Castle library (BC Provider, BC JSSE and PKIX/CMS/EAC/PKCS/OCSP/TSP/OPENSSL jars), usually the latest available version.
Please report bugs and incompatibilities (preferably with test-cases) to either the JRuby mailing list or the bug tracker.
Check latest jruby-openssl gem spec's jar requirements for compatibility.
require 'openssl'
JOpenSSL::VERSIONFor older versions of the gem compatibility wasn't reported:
| JRuby-OpenSSL | JRuby compat | JVM compat | supported BC |
|---|---|---|---|
| ~>0.12.x | 9.1.x-9.3.x | Java 8-15 | 1.65-1.68 |
| ~>0.13.x | 9.1.x-9.4.x | Java 8-17 | 1.68-1.69 |
| ~>0.14.x | 9.1.x-9.4.x | Java 8-21 | 1.71-1.74 |
| ~>0.15.x | 9.2.x-10.0.x | Java 8-25 | 1.78-1.83 |
| ~>0.16.x | 9.3.x-10.0.x | Java 8-25 | 1.83-1.85 |
JRuby-OpenSSL is an essential part of JRuby, please report security vulnerabilities to security@jruby.org as detailed on JRuby's security page or using GitHub.
Please note that most OpenSSL vulnerabilities do not affect JRuby since it's not using any of OpenSSL's C code, only Ruby parts (*.rb) are the same as in MRI's OpenSSL library.
Most runtime knobs are Java system properties. Under JRuby you pass them as -J-D... flags, e.g. JRUBY_OPTS='-J-Djruby.openssl.debug=true'.
| Property | Default | Effect |
|---|---|---|
| jruby.openssl.load.jars | true | If set to false, lib/jopenssl/load.rb skips auto-loading the bundled BouncyCastle jars - handy when the BC jars are on the JVM classpath. |
| jruby.openssl.debug | false | Turns on internal debug logging and stack traces from the Java extension, has the same effect as setting OpenSSL.debug = true at runtime. |
| jruby.openssl.warn | follows JRuby's warning mode (runtime.warningsEnabled()) | Enables or disables warnings from the extension, set false to stay quiet regardless of -w. |
| jruby.openssl.log.logger | default stdout/stderr logger | Selects the internal logger implementation, set to JUL to route logs through java.util.logging. |
| jruby.openssl.log.silence | true | Silences a few noisy BC / BC-JSSE loggers by default, set false to leave their levels untouched. |
| jruby.openssl.provider.ssl | BCJSSE | Selects the SSL provider. BCJSSE, BC, or true all mean BC-JSSE, an empty string or false falls back to the platform JSSE provider. |
| jruby.openssl.ssl.error_wait_nonblock.backtrace | falls back to jruby.errno.backtrace (which defaults to false) | Whether SSLErrorWaitReadable / SSLErrorWaitWritable carry backtraces. |
| jruby.openssl.x509.lookup.cache | disabled | Caching for X.509 lookup results. true turns on a soft cache; an integer such as 8 gives a bounded strong/soft cache of that size, unset or false disables it. |
| Variable | Default | Effect |
|---|---|---|
| SSL_CERT_FILE | platform / packaged default CA file | Overrides the default certificate bundle used for X.509 default-path loading, .crt, .cer, or .pem are read as a PEM bundle, otherwise treated as a Java CA store path. |
| SSL_CERT_DIR | platform / packaged default CA directory | Overrides the default certificate directory list for X.509 default-path loading, separate multiple directories with the platform path separator. |
| OPENSSL_ALLOW_PROXY_CERTS | unset / disabled | When set to anything other than false, proxy certificates are allowed during certificate chain validation. |
JRuby-OpenSSL aims to be a source-compatible drop-in for MRI's openssl - same Ruby API and same require 'openssl'. But there are limitations on the JVM (with JCE and JSSE) as well as Bouncy Castle libraries, so some entry points are unavailable, behave differently, or are no-ops.
Engine
SSL / TLS (backed by JSSE)
Cipher (JCE / Bouncy Castle)
PKey (EC / DH / EdDSA)
X509
Random
Other
Hitting something not listed here that MRI's OpenSSL supports? Please report it on the bug tracker, ideally with a test case.
A FIPS 140-3 build of jruby-openssl is available as a separate gem. It's the very same library but uses the NIST-validated BC FIPS module (BC-FJA) instead of regular Bouncy Castle, for deployments that need a validated cryptographic module. Ships separately under GPL 3.0, with commercial licensing available - see the FIPS variant wiki page for details.
NOTE: unlike C OpenSSL, OpenSSL.fips_mode cannot be changed at runtime, the flag reports which gem variant is activated (true under the FIPS gem, false otherwise).
(c) 2009-2026 JRuby distributed under EPL 1.0 / GPL 2.0 / LGPL 2.1
| Back | FazBrowse Home | New Git URL |