Sha256: 96fae51d4b3f3cfde4482bb35d4b77115aad517d13fc47e8b1e978e62899d62a

Contents?: true

Size: 675 Bytes

Versions: 62

Compression:

Stored size: 675 Bytes

Contents

require 'net/http'

# ActiveMerchant 1.79.2 introduced a bug in their refinement of
# +Net::HTTP+ when using with +VCR+, since VCR overrides the
# +Net::HTTP#start+ method as a means of sandboxing HTTP requests from
# being actually run in favor of using the stored response. This sets
# all the other variables Net::HTTP is expecting except for +@socket+,
# resulting in an error when using a real payment gateway with AM.

if Rails.env.test?
  NetHttpSslConnection.module_eval do
    refine Net::HTTP do
      def ssl_connection
        return {} unless @socket.present?
        { version: @socket.io.ssl_version, cipher: @socket.io.cipher[0] }
      end
    end
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
workarea-core-3.5.27 lib/workarea/ext/freedom_patches/net_http_ssl_connection.rb
workarea-core-3.5.26 lib/workarea/ext/freedom_patches/net_http_ssl_connection.rb
workarea-core-3.4.45 lib/workarea/ext/freedom_patches/net_http_ssl_connection.rb
workarea-core-3.5.25 lib/workarea/ext/freedom_patches/net_http_ssl_connection.rb
workarea-core-3.5.23 lib/workarea/ext/freedom_patches/net_http_ssl_connection.rb
workarea-core-3.4.44 lib/workarea/ext/freedom_patches/net_http_ssl_connection.rb
workarea-core-3.5.22 lib/workarea/ext/freedom_patches/net_http_ssl_connection.rb
workarea-core-3.4.43 lib/workarea/ext/freedom_patches/net_http_ssl_connection.rb
workarea-core-3.5.21 lib/workarea/ext/freedom_patches/net_http_ssl_connection.rb
workarea-core-3.4.42 lib/workarea/ext/freedom_patches/net_http_ssl_connection.rb
workarea-core-3.5.20 lib/workarea/ext/freedom_patches/net_http_ssl_connection.rb
workarea-core-3.4.41 lib/workarea/ext/freedom_patches/net_http_ssl_connection.rb
workarea-core-3.5.19 lib/workarea/ext/freedom_patches/net_http_ssl_connection.rb
workarea-core-3.4.40 lib/workarea/ext/freedom_patches/net_http_ssl_connection.rb
workarea-core-3.5.18 lib/workarea/ext/freedom_patches/net_http_ssl_connection.rb
workarea-core-3.4.39 lib/workarea/ext/freedom_patches/net_http_ssl_connection.rb
workarea-core-3.5.17 lib/workarea/ext/freedom_patches/net_http_ssl_connection.rb
workarea-core-3.4.38 lib/workarea/ext/freedom_patches/net_http_ssl_connection.rb
workarea-core-3.5.16 lib/workarea/ext/freedom_patches/net_http_ssl_connection.rb
workarea-core-3.4.37 lib/workarea/ext/freedom_patches/net_http_ssl_connection.rb