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.15 lib/workarea/ext/freedom_patches/net_http_ssl_connection.rb
workarea-core-3.4.36 lib/workarea/ext/freedom_patches/net_http_ssl_connection.rb
workarea-core-3.5.14 lib/workarea/ext/freedom_patches/net_http_ssl_connection.rb
workarea-core-3.4.35 lib/workarea/ext/freedom_patches/net_http_ssl_connection.rb
workarea-core-3.5.13 lib/workarea/ext/freedom_patches/net_http_ssl_connection.rb
workarea-core-3.4.34 lib/workarea/ext/freedom_patches/net_http_ssl_connection.rb
workarea-core-3.5.12 lib/workarea/ext/freedom_patches/net_http_ssl_connection.rb
workarea-core-3.4.33 lib/workarea/ext/freedom_patches/net_http_ssl_connection.rb
workarea-core-3.5.11 lib/workarea/ext/freedom_patches/net_http_ssl_connection.rb
workarea-core-3.5.10 lib/workarea/ext/freedom_patches/net_http_ssl_connection.rb
workarea-core-3.4.32 lib/workarea/ext/freedom_patches/net_http_ssl_connection.rb
workarea-core-3.5.9 lib/workarea/ext/freedom_patches/net_http_ssl_connection.rb
workarea-core-3.4.31 lib/workarea/ext/freedom_patches/net_http_ssl_connection.rb
workarea-core-3.5.8 lib/workarea/ext/freedom_patches/net_http_ssl_connection.rb
workarea-core-3.4.30 lib/workarea/ext/freedom_patches/net_http_ssl_connection.rb
workarea-core-3.5.7 lib/workarea/ext/freedom_patches/net_http_ssl_connection.rb
workarea-core-3.4.29 lib/workarea/ext/freedom_patches/net_http_ssl_connection.rb
workarea-core-3.5.6 lib/workarea/ext/freedom_patches/net_http_ssl_connection.rb
workarea-core-3.4.28 lib/workarea/ext/freedom_patches/net_http_ssl_connection.rb
workarea-core-3.5.5 lib/workarea/ext/freedom_patches/net_http_ssl_connection.rb