Skip to content

Commit

Permalink
Merge pull request #167 from jruby/jruby-load-ext
Browse files Browse the repository at this point in the history
loading JOpenSSL's native ext part the JRuby 9.2 (internal) way
  • Loading branch information
kares committed Jun 19, 2018
2 parents 4b67129 + 4797873 commit 1ee9f7b
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 1ee9f7b

Please sign in to comment.