Method: ActiveMerchant::PostsData#raw_ssl_request

Defined in:
lib/active_merchant/posts_data.rb

#raw_ssl_request(method, endpoint, data, headers = {}) ⇒ Object



49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/active_merchant/posts_data.rb', line 49

def raw_ssl_request(method, endpoint, data, headers = {})
  logger&.warn "#{self.class} using ssl_strict=false, which is insecure" unless ssl_strict
  logger&.warn "#{self.class} posting to plaintext endpoint, which is insecure" unless endpoint.to_s =~ /^https:/

  connection = new_connection(endpoint)
  connection.open_timeout = open_timeout
  connection.read_timeout = read_timeout
  connection.retry_safe   = retry_safe
  connection.verify_peer  = ssl_strict
  connection.ssl_version  = ssl_version
  connection.logger       = logger
  connection.max_retries  = max_retries
  connection.tag          = self.class.name
  connection.wiredump_device = wiredump_device
  if connection.respond_to?(:min_version=)
    connection.min_version = min_version
    connection.max_version = max_version
  end

  connection.pem          = @options[:pem] if @options
  connection.pem_password = @options[:pem_password] if @options

  connection.ignore_http_status = @options[:ignore_http_status] if @options

  connection.proxy_address  = proxy_address
  connection.proxy_port     = proxy_port
  connection.proxy_user     = proxy_user
  connection.proxy_password = proxy_password

  connection.request(method, data, headers)
end