{"action":"created","issue":{"url":"https://api.github.com/repos/WinRb/WinRM/issues/208","repository_url":"https://api.github.com/repos/WinRb/WinRM","labels_url":"https://api.github.com/repos/WinRb/WinRM/issues/208/labels{/name}","comments_url":"https://api.github.com/repos/WinRb/WinRM/issues/208/comments","events_url":"https://api.github.com/repos/WinRb/WinRM/issues/208/events","html_url":"https://github.com/WinRb/WinRM/issues/208","id":152842854,"number":208,"title":"`init_auth': undefined method `split' for nil:NilClass","user":{"login":"JaBurd","id":9771777,"avatar_url":"https://avatars.githubusercontent.com/u/9771777?v=3","gravatar_id":"","url":"https://api.github.com/users/JaBurd","html_url":"https://github.com/JaBurd","followers_url":"https://api.github.com/users/JaBurd/followers","following_url":"https://api.github.com/users/JaBurd/following{/other_user}","gists_url":"https://api.github.com/users/JaBurd/gists{/gist_id}","starred_url":"https://api.github.com/users/JaBurd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JaBurd/subscriptions","organizations_url":"https://api.github.com/users/JaBurd/orgs","repos_url":"https://api.github.com/users/JaBurd/repos","events_url":"https://api.github.com/users/JaBurd/events{/privacy}","received_events_url":"https://api.github.com/users/JaBurd/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":15,"created_at":"2016-05-03T18:28:47Z","updated_at":"2016-06-14T18:46:19Z","closed_at":null,"body":"When running a kitchen converge on a windows node from my Mac I'm getting the following error when Kitchen attempts to connect via winrm to my ec2 instance.   Please note I have proxies involved and are most likely the culprit, but would like to see if its not something I'm doing wrong.\r\n\r\n    >>>>>> ------Exception-------\r\n    >>>>>> Class: Kitchen::ActionFailed\r\n    >>>>>> Message: Failed to complete #converge action: [undefined method `split' for nil:NilClass]\r\n    >>>>>> ----------------------\r\n    >>>>>> Please see .kitchen/logs/kitchen.log for more details\r\n    >>>>>> Also try running `kitchen diagnose --all` for configuration\r\n\r\nDoing some additional digging I attempted to isolate the winrm connection and using the readme I built a ruby script to perform the winrm connection independently:\r\n\r\n    require 'winrm'\r\n    endpoint = 'http://ipaddress:5985/wsman'\r\n    winrm = WinRM::WinRMWebService.new(endpoint, :negotiate, :user => 'Administrator', :pass => 'password')\r\n    winrm.create_executor do |executor|\r\n        executor.run_cmd('ipconfig /all') do |stdout, stderr|\r\n            STDOUT.print stdout\r\n            STDERR.print stderr\r\n        end\r\n    end\r\n\r\nThis returns the following error:\r\n\r\n    .chefdk/gem/ruby/2.1.0/gems/winrm-1.8.0/lib/winrm/http/transport.rb:231:in `init_auth': undefined method `split' for nil:NilClass (NoMethodError)\r\n    from ~.chefdk/gem/ruby/2.1.0/gems/winrm-1.8.0/lib/winrm/http/transport.rb:171:in `send_request'\r\n    from ~.chefdk/gem/ruby/2.1.0/gems/winrm-1.8.0/lib/winrm/winrm_service.rb:492:in `send_message'\r\n    from ~.chefdk/gem/ruby/2.1.0/gems/winrm-1.8.0/lib/winrm/winrm_service.rb:393:in `run_wql'\r\n    from ~.chefdk/gem/ruby/2.1.0/gems/winrm-1.8.0/lib/winrm/command_executor.rb:190:in `os_version'\r\n    from ~.chefdk/gem/ruby/2.1.0/gems/winrm-1.8.0/lib/winrm/command_executor.rb:149:in `code_page'\r\n    from ~.chefdk/gem/ruby/2.1.0/gems/winrm-1.8.0/lib/winrm/command_executor.rb:72:in `block in open'\r\n    from ~.chefdk/gem/ruby/2.1.0/gems/winrm-1.8.0/lib/winrm/command_executor.rb:222:in `retryable'\r\n    from ~.chefdk/gem/ruby/2.1.0/gems/winrm-1.8.0/lib/winrm/command_executor.rb:71:in `open'\r\n    from ~.chefdk/gem/ruby/2.1.0/gems/winrm-1.8.0/lib/winrm/winrm_service.rb:359:in `create_executor'\r\n    from winrm_test.rb:4:in `<main>'`\r\n\r\nReviewing the  code, it appears this is the negotiate step, but I don't have enough knowledge of winrm to know what exactly is failing and it must be nil because r isn't getting populated.\r\n\r\n    def init_auth\r\n      @logger.debug \"Initializing Negotiate for #{@service}\"\r\n      auth1 = @ntlmcli.init_context\r\n      hdr = {\"Authorization\" => \"Negotiate #{auth1.encode64}\",\r\n             \"Content-Type\" => \"application/soap+xml;charset=UTF-8\"\r\n      }\r\n      @logger.debug \"Sending HTTP POST for Negotiate Authentication\"\r\n      r = @httpcli.post(@endpoint, \"\", hdr)\r\n      verify_ssl_fingerprint(r.peer_cert)\r\n      itok = r.header[\"WWW-Authenticate\"].pop.split.last\r\n      binding = r.peer_cert.nil? ? nil : Net::NTLM::ChannelBinding.create(r.peer_cert)\r\n      auth3 = @ntlmcli.init_context(itok, binding)\r\n      { \"Authorization\" => \"Negotiate #{auth3.encode64}\" }\r\n    end\r\n\r\nAny thoughts, ideas appreciated."},"comment":{"url":"https://api.github.com/repos/WinRb/WinRM/issues/comments/225978356","html_url":"https://github.com/WinRb/WinRM/issues/208#issuecomment-225978356","issue_url":"https://api.github.com/repos/WinRb/WinRM/issues/208","id":225978356,"user":{"login":"mwrock","id":655165,"avatar_url":"https://avatars.githubusercontent.com/u/655165?v=3","gravatar_id":"","url":"https://api.github.com/users/mwrock","html_url":"https://github.com/mwrock","followers_url":"https://api.github.com/users/mwrock/followers","following_url":"https://api.github.com/users/mwrock/following{/other_user}","gists_url":"https://api.github.com/users/mwrock/gists{/gist_id}","starred_url":"https://api.github.com/users/mwrock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwrock/subscriptions","organizations_url":"https://api.github.com/users/mwrock/orgs","repos_url":"https://api.github.com/users/mwrock/repos","events_url":"https://api.github.com/users/mwrock/events{/privacy}","received_events_url":"https://api.github.com/users/mwrock/received_events","type":"User","site_admin":false},"created_at":"2016-06-14T18:46:19Z","updated_at":"2016-06-14T18:46:19Z","body":"The httpclient gem owns the underlying code: https://github.com/nahi/httpclient/blob/master/lib/httpclient.rb and is the best place to add cidr support"}}
{"actor":{"display_login":"mwrock"}}