lib/chef/knife/winrm_knife_base.rb in knife-windows-1.1.4 vs lib/chef/knife/winrm_knife_base.rb in knife-windows-1.2.0
- old
+ new
@@ -49,21 +49,10 @@
ui.error "Invalid value '#{winrm_auth_protocol}' for --winrm-authentication-protocol option."
ui.info "Valid values are #{Chef::Knife::WinrmBase::WINRM_AUTH_PROTOCOL_LIST.join(",")}."
exit 1
end
- if negotiate_auth? && !Chef::Platform.windows? && !(locate_config_value(:winrm_transport) == 'ssl')
- ui.warn <<-eos.gsub /^\s+/, ""
- You are using '--winrm-authentication-protocol negotiate' with
- '--winrm-transport plaintext' on a non-Windows system which results in
- unencrypted traffic. To avoid this warning and secure communication,
- use '--winrm-transport ssl' instead of the plaintext transport,
- or execute this command from a Windows system which enables encrypted
- communication over plaintext with the negotiate authentication protocol.
- eos
- end
-
warn_no_ssl_peer_verification if resolve_no_ssl_peer_verification
end
#Overrides Chef::Knife#configure_session, as that code is tied to the SSH implementation
#Tracked by Issue # 3042 / https://github.com/chef/chef/issues/3042
@@ -257,22 +246,22 @@
def resolve_winrm_transport
transport = locate_config_value(:winrm_transport).to_sym
if config.any? {|k,v| k.to_s =~ /kerberos/ && !v.nil? }
transport = :kerberos
- elsif Chef::Platform.windows? && transport != :ssl && negotiate_auth?
- transport = :sspinegotiate
+ elsif transport != :ssl && negotiate_auth?
+ transport = :negotiate
end
transport
end
def resolve_no_ssl_peer_verification
locate_config_value(:ca_trust_file).nil? && config[:winrm_ssl_verify_mode] == :verify_none && resolve_winrm_transport == :ssl
end
def resolve_winrm_disable_sspi
- !Chef::Platform.windows? || resolve_winrm_transport == :ssl || !negotiate_auth?
+ resolve_winrm_transport != :negotiate
end
def get_password
@password ||= ui.ask("Enter your password: ") { |q| q.echo = false }
end