diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2017-08-11 11:03:02 -0300 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2017-08-12 11:21:59 -0300 |
commit | dbac58918e75f8e7df9875f7363985cd3a1fae01 (patch) | |
tree | 4c61256a72e07e27b2367a00acac1866a2fd0ba5 | |
parent | ff3c95e570010e6bfe56d094119fb928a52886be (diff) | |
download | bundler-seg-warn-old-tls.tar.gz |
Update outdated TLS warning to link to new bundler guideseg-warn-old-tls
-rw-r--r-- | lib/bundler/vendored_persistent.rb | 11 | ||||
-rw-r--r-- | spec/bundler/vendored_persistent_spec.rb | 10 |
2 files changed, 14 insertions, 7 deletions
diff --git a/lib/bundler/vendored_persistent.rb b/lib/bundler/vendored_persistent.rb index 769a9a6d20..190fed58e5 100644 --- a/lib/bundler/vendored_persistent.rb +++ b/lib/bundler/vendored_persistent.rb @@ -37,10 +37,13 @@ module Bundler case ssl_version when /TLSv([\d\.]+)/ version = Gem::Version.new($1) - if version < Gem::Version.new("1.1") - Bundler.ui.warn "Your Ruby version does not support TLSv1.1 or newer" \ - ", which will be required to connect to https://#{uri.hostname}" \ - " by January 2018." + if version < Gem::Version.new("1.2") + Bundler.ui.warn \ + "Warning: Your Ruby version is compiled against a copy of OpenSSL that is very old. " \ + "Starting in January 2018, RubyGems.org will refuse connection requests from these " \ + "very old versions of OpenSSL. If you will need to continue installing gems after " \ + "January 2018, please follow this guide to upgrade: http://ruby.to/tls-outdated.", + :wrap => true end end end diff --git a/spec/bundler/vendored_persistent_spec.rb b/spec/bundler/vendored_persistent_spec.rb index d4b1807e34..b1b091f2c5 100644 --- a/spec/bundler/vendored_persistent_spec.rb +++ b/spec/bundler/vendored_persistent_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require "spec_helper" require "bundler/vendored_persistent" @@ -27,9 +28,9 @@ RSpec.describe Bundler::PersistentHTTP do end end - shared_examples_for "does warn" do |expected| + shared_examples_for "does warn" do |*expected| it "warns" do - expect(Bundler.ui).to receive(:warn).with(expected) + expect(Bundler.ui).to receive(:warn).with(*expected) subject.warn_old_tls_version_rubygems_connection(URI(uri), connection) end end @@ -62,7 +63,10 @@ RSpec.describe Bundler::PersistentHTTP do context "with an outdated TLS version" do let(:tls_version) { "TLSv1" } include_examples "does warn", - "Your Ruby version does not support TLSv1.1 or newer, which will be required to connect to https://index.rubygems.org by January 2018." + "Warning: Your Ruby version is compiled against a copy of OpenSSL that is very old. " \ + "Starting in January 2018, RubyGems.org will refuse connection requests from these very old versions of OpenSSL. " \ + "If you will need to continue installing gems after January 2018, please follow this guide to upgrade: http://ruby.to/tls-outdated.", + :wrap => true end end end |