However, this functionality is not fully compatible with ruby openssl. I did some investigation and apparently jruby-openssl was implemented based on openssl 0.9.x. Ruby 2.7 is using openssl 1.1.1.
There was a refactoring in openssl between 0.9.x and 1.1.1, e.g. following does work with ruby, but not with jruby:
Fixes #221 and jruby/jruby#3100
However, this functionality is not fully compatible with ruby openssl. I did some investigation and apparently jruby-openssl was implemented based on openssl 0.9.x. Ruby 2.7 is using openssl 1.1.1. There was a refactoring in openssl between 0.9.x and 1.1.1, e.g. following does work with ruby, but not with jruby:
but this works with both: