Module Wrest::Native::ConnectionFactory

  1. lib/wrest/native/connection_factory.rb

Methods

public instance

  1. create_connection

Public instance methods

create_connection (options = {:timeout => 60, :verify_mode => OpenSSL::SSL::VERIFY_NONE})
[show source]
    # File lib/wrest/native/connection_factory.rb, line 12
12:     def create_connection(options = {:timeout => 60, :verify_mode => OpenSSL::SSL::VERIFY_NONE})
13:       options[:timeout] ||= 60
14:       connection = Net::HTTP.new(self.host, self.port)
15:       connection.read_timeout = options[:timeout]
16:       if self.https?
17:         connection.use_ssl     = true
18:         connection.verify_mode = options[:verify_mode]? options[:verify_mode] : OpenSSL::SSL::VERIFY_PEER 
19:         
20:       end
21:       connection
22:     end