Module: Wrest::Native::ConnectionFactory
- Defined in:
- lib/wrest/native/connection_factory.rb
Instance Method Summary collapse
Instance Method Details
#create_connection(options = { timeout: 60, verify_mode: OpenSSL::SSL::VERIFY_NONE }) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/wrest/native/connection_factory.rb', line 15 def create_connection( = { timeout: 60, verify_mode: OpenSSL::SSL::VERIFY_NONE }) [:timeout] ||= 60 connection = Net::HTTP.new(host, port) connection.read_timeout = [:timeout] if https? connection.use_ssl = true connection.verify_mode = [:verify_mode] || OpenSSL::SSL::VERIFY_PEER connection.ca_path = [:ca_path] if [:ca_path] end connection end |