Class: WinRM::HTTP::ClientCertAuthSSL

Inherits:
HttpTransport show all
Defined in:
lib/winrm/http/transport.rb

Overview

Uses Client Certificate to authenticate and SSL to secure the transport

Instance Attribute Summary

Attributes inherited from HttpTransport

#endpoint

Instance Method Summary collapse

Methods inherited from HttpTransport

#basic_auth_only!, #no_ssl_peer_verification!, #no_sspi_auth!, #send_request, #ssl_peer_fingerprint_verification!, #verify_ssl_fingerprint, #with_untrusted_ssl_connection

Constructor Details

#initialize(endpoint, client_cert, client_key, key_pass, opts) ⇒ ClientCertAuthSSL

Returns a new instance of ClientCertAuthSSL.



276
277
278
279
280
281
282
283
# File 'lib/winrm/http/transport.rb', line 276

def initialize(endpoint, client_cert, client_key, key_pass, opts)
  super(endpoint, opts)
  @httpcli.ssl_config.set_client_cert_file(client_cert, client_key, key_pass)
  @httpcli.www_auth.instance_variable_set('@authenticator', [])
  no_ssl_peer_verification! if opts[:no_ssl_peer_verification]
  @ssl_peer_fingerprint = opts[:ssl_peer_fingerprint]
  @httpcli.ssl_config.set_trust_ca(opts[:ca_trust_path]) if opts[:ca_trust_path]
end