Add WinRM over SSL support - (replaces #3960)#4236
Conversation
|
@sneal a few questions before I make other updates:
Any thoughts on the questions above or comments in the OP? |
|
I'm glad to see this, thanks. I see no need to keep the naming convention of options consistent with the winrm gem, its an implementation detail that most users won't be aware of. I'm not a fan of 'no_ssl_peer_verification', I believe its only that way in the winrm gem because the other existing options start with 'no_'. I would rather just forward one port. Using |
|
Great! I think that answers all my questions, so hopefully I can get all the changes done soon. FYIs:
|
|
@pdericson No problem. @sneal if you merge my changes you can squash my commits, but make sure not to squash them w/ @pdericson's so he gets credit for the original work ;) @sneal - I think I've addressed most of my comments except for forwarding two ports instead of one. Please checkout the changes and let me know if anythings looks funky. I've just been trusting the unit tests so far, but I'm going to test it with real WinRM connections for VirtualBox and/or vagrant-rackspace soon. |
|
@sneal Also, I cleaned up shell.rb/config.rb to be more DRY - they both specified default values, and the timeout didn't match. I've got it set to 60 now... can you confirm the intended default timeout in seconds? |
There was a problem hiding this comment.
This should default to :plaintext otherwise existing users will be angry at us for breaking their boxes.
There was a problem hiding this comment.
Fair enough, but I have some concerns about Vagrant being insecure by default and without adequate warnings about insecure remote connections. I created #4241 to discuss how to balance short-term compatibility w/ long-term security goals.
|
@sneal I think it's functional now. I tested it with vagrant-rackspace. There are some usability issues to workout, though. I noted two:
Any tips on the error handling? I opened WinRb/WinRM#78 because I think it might be easier if we had direct access to the HTTP response code. |
|
@maxlinc As an idea for error handling: communicators get called with this: https://github.com/mitchellh/vagrant/blob/a0a46bfdfa27593e3924b62c96c45a07c71f1cf4/plugins/communicators/ssh/communicator.rb#L38 WinRM doesn't implement it because Vagrant has a sane default. But if you implement that, you can basically catch "auth failed 3 times in a row, credentials are probably just wrong" sort of errors if you can extract that detail from WinRM. Let me know when you want a deeper review. |
|
@sneal I've pretty much got this behaving the way I want, but I'm going to need your help to finish the error handling. There's two issues:
Take a look at There's also a lot of similarities between SSH and WinRM exception handling, but I'd rather finish up WinRM specs first then refactor to de-duplicate the logic. |
|
@mitchellh this is ready for deeper review. I split the SSL & error handling into separate PRs to make it easier. I see you already commented on the error handling changes in #4943. The only issue I'm aware of is the pre-release gem, as already noted on #4943. Just waiting for WinRM 1.3.0... P.s. While I've got your attention do you think you could enable the travis-hook for vagrant-rackspace? |
|
@maxlinc Branch won't cleanly merge |
|
Yeah... that's why I don't like long-lived branches (though I understand why it was necessary). I'll try to rebase... |
Conflicts: vagrant.gemspec
|
Fixed. It was just a trivial conflict with the version for winrm (1.3.0 vs 1.3 - I've used your choice, 1.3, which is more correct). |
There was a problem hiding this comment.
This test is confusing, there isn't a :winrmssl communicator type that I see.
There was a problem hiding this comment.
You're right... it should just be :winrm.
The test is supposed to be for the second network forwarded for winrm, though. See https://github.com/maxlinc/vagrant/blob/winrmssl/plugins/kernel_v2/config/vm.rb#L403-L408.
Also your the discussion on #4932, including your response:
It seems logical to only automatically forward networks as required by the active communicator. I don't think its currently breaking anything by automatically forwarding both, but its sloppy.
I don't care if it's zero (the cloud providers don't use forwarded ports, AFAIK), one (cleaner) or two (easier to switch - because I changing forwarded ports requires a reload). I'll fix the communicator to be winrm though.
|
WOMM. @maxlinc did you want to update the test before I merge this? Its just a nit, not a requirement. Disabling http on the guest box (leaving https enabled) while leaving the transport the default of :plaintext, it hung Vagrant. Probably existing behavior. |
Add WinRM over SSL support - (replaces #3960)
I updated @pdericson's PR #3960 to:
I'm planning to address my comments from that PR as well:
I just wanted to start see Travis go green and open the discussion back up.