communicator/winrm: Fixed HTTPS when using copy client.
This commit is contained in:
parent
f7ef36b86d
commit
f46a629d72
|
@ -193,12 +193,21 @@ func (c *Communicator) UploadDir(dst string, src string) error {
|
||||||
|
|
||||||
func (c *Communicator) newCopyClient() (*winrmcp.Winrmcp, error) {
|
func (c *Communicator) newCopyClient() (*winrmcp.Winrmcp, error) {
|
||||||
addr := fmt.Sprintf("%s:%d", c.endpoint.Host, c.endpoint.Port)
|
addr := fmt.Sprintf("%s:%d", c.endpoint.Host, c.endpoint.Port)
|
||||||
return winrmcp.New(addr, &winrmcp.Config{
|
|
||||||
|
config := winrmcp.Config{
|
||||||
Auth: winrmcp.Auth{
|
Auth: winrmcp.Auth{
|
||||||
User: c.connInfo.User,
|
User: c.connInfo.User,
|
||||||
Password: c.connInfo.Password,
|
Password: c.connInfo.Password,
|
||||||
},
|
},
|
||||||
|
Https: c.connInfo.HTTPS,
|
||||||
|
Insecure: c.connInfo.Insecure,
|
||||||
OperationTimeout: c.Timeout(),
|
OperationTimeout: c.Timeout(),
|
||||||
MaxOperationsPerShell: 15, // lowest common denominator
|
MaxOperationsPerShell: 15, // lowest common denominator
|
||||||
})
|
}
|
||||||
|
|
||||||
|
if c.connInfo.CACert != nil {
|
||||||
|
config.CACertBytes = *c.connInfo.CACert
|
||||||
|
}
|
||||||
|
|
||||||
|
return winrmcp.New(addr, &config)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue