Class: WinRM::HTTP::HttpGSSAPI
- Inherits:
-
HttpTransport
- Object
- HttpTransport
- WinRM::HTTP::HttpGSSAPI
- Defined in:
- lib/winrm/http/transport.rb
Overview
Uses Kerberos/GSSAPI to authenticate and encrypt messages rubocop:disable Metrics/ClassLength
Constant Summary
Constants inherited from HttpTransport
WinRM::HTTP::HttpTransport::DEFAULT_RECEIVE_TIMEOUT
Instance Attribute Summary
Attributes inherited from HttpTransport
Instance Method Summary collapse
-
#initialize(endpoint, realm, service = nil, keytab = nil, opts) ⇒ HttpGSSAPI
constructor
rubocop:disable Lint/UnusedMethodArgument.
-
#send_request(message) ⇒ Object
Sends the SOAP payload to the WinRM service and returns the service’s SOAP response.
Methods inherited from HttpTransport
#basic_auth_only!, #no_ssl_peer_verification!, #no_sspi_auth!, #receive_timeout, #receive_timeout=, #ssl_peer_fingerprint_verification!, #verify_ssl_fingerprint, #with_untrusted_ssl_connection
Constructor Details
#initialize(endpoint, realm, service = nil, keytab = nil, opts) ⇒ HttpGSSAPI
rubocop:disable Lint/UnusedMethodArgument
163 164 165 166 167 168 169 170 171 |
# File 'lib/winrm/http/transport.rb', line 163 def initialize(endpoint, realm, service = nil, keytab = nil, opts) # rubocop:enable Lint/UnusedMethodArgument super(endpoint) # Remove the GSSAPI auth from HTTPClient because we are doing our own thing no_sspi_auth! service ||= 'HTTP' @service = "#{service}/#{@endpoint.host}@#{realm}" init_krb end |
Instance Method Details
#send_request(message) ⇒ Object
Sends the SOAP payload to the WinRM service and returns the service’s SOAP response. If an error occurrs an appropriate error is raised.
178 179 180 181 182 183 184 185 186 187 188 189 |
# File 'lib/winrm/http/transport.rb', line 178 def send_request() resp = send_kerberos_request() if resp.status == 401 @logger.debug 'Got 401 - reinitializing Kerberos and retrying one more time' init_krb resp = send_kerberos_request() end handler = WinRM::ResponseHandler.new(winrm_decrypt(resp.http_body.content), resp.status) handler.parse_to_xml end |