cleaner initialization of winrmcp

This commit is contained in:
Joe Khoobyar 2018-03-30 21:32:46 -04:00
parent 852a74c49d
commit d7cb9baa43
1 changed files with 4 additions and 1 deletions

View File

@ -214,10 +214,13 @@ func (c *Communicator) newCopyClient() (*winrmcp.Winrmcp, error) {
},
Https: c.connInfo.HTTPS,
Insecure: c.connInfo.Insecure,
TransportDecorator: c.client.TransportDecorator,
OperationTimeout: c.Timeout(),
MaxOperationsPerShell: 15, // lowest common denominator
}
if c.connInfo.NTLM == true {
config.TransportDecorator = func() winrm.Transporter { return &winrm.ClientNTLM{} }
}
if c.connInfo.CACert != "" {
config.CACertBytes = []byte(c.connInfo.CACert)