Class: Rbeapi::Eapilib::HttpsEapiConnection

Inherits:
EapiConnection show all
Defined in:
lib/rbeapi/eapilib.rb

Instance Attribute Summary

Attributes inherited from EapiConnection

#error

Instance Method Summary collapse

Methods inherited from EapiConnection

#authentication, #execute, #request, #send

Constructor Details

#initialize(opts = {}) ⇒ HttpsEapiConnection

Returns a new instance of HttpsEapiConnection.


319
320
321
322
323
324
325
326
327
328
329
330
331
# File 'lib/rbeapi/eapilib.rb', line 319

def initialize(opts = {})
  host = opts.fetch(:host, 'localhost')
  port = opts.fetch(:port, DEFAULT_HTTPS_PORT)

  transport = Net::HTTP.new(host, port)
  transport.use_ssl = true
  transport.verify_mode = OpenSSL::SSL::VERIFY_NONE
  super(transport)

  user = opts.fetch(:username, 'admin')
  pass = opts.fetch(:password, '')
  authentication(user, pass)
end