From 0dd9d1152c1dffb3e7f229d6f671f238719af576 Mon Sep 17 00:00:00 2001 From: HoneyryderChuck Date: Sat, 17 Feb 2018 16:23:47 +0000 Subject: [PATCH] disable ssl verification in ruby 2.5 --- test/test_helper.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/test_helper.rb b/test/test_helper.rb index ddbc2256..abba2087 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -14,5 +14,13 @@ end require "httpx" +# TODO: remove this once ruby 2.5 bug is fixed: +# https://github.com/ruby/openssl/issues/187 +if RUBY_ENGINE == "ruby" && + RUBY_VERSION == "2.5.0" && + ENV.key?("SSL_CERT_FILE") + OpenSSL::SSL::SSLContext::DEFAULT_PARAMS[:verify_mode] = 0 +end + Dir[File.join(".", "test", "support", "*.rb")].each { |f| require f } Dir[File.join(".", "test", "support", "**", "*.rb")].each { |f| require f }