Skip to content

Commit

Permalink
loading JOpenSSL's native ext part the JRuby 9.2 (internal) way
Browse files Browse the repository at this point in the history
  • Loading branch information
kares committed Jun 1, 2018
1 parent b5a74f8 commit 4797873
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/jopenssl/load.rb
@@ -1,6 +1,5 @@
warn 'Loading jruby-openssl gem in a non-JRuby interpreter' unless defined? JRUBY_VERSION

require 'java'
require 'jopenssl/version'

warn "JRuby #{JRUBY_VERSION} is not supported by jruby-openssl #{JOpenSSL::VERSION}" if JRUBY_VERSION < '1.7.20'
Expand All @@ -26,9 +25,13 @@
end
end

require 'jruby'
require 'jopenssl.jar'
org.jruby.ext.openssl.OpenSSL.load(JRuby.runtime)

if JRuby::Util.respond_to?(:load_ext) # JRuby 9.2
JRuby::Util.load_ext('org.jruby.ext.openssl.OpenSSL')
else; require 'jruby'
org.jruby.ext.openssl.OpenSSL.load(JRuby.runtime)
end

if RUBY_VERSION > '2.3'
load 'jopenssl23/openssl.rb'
Expand Down

0 comments on commit 4797873

Please sign in to comment.