0
0
mirror of https://github.com/bpg/terraform-provider-proxmox.git synced 2025-06-30 02:31:10 +00:00
terraform-provider-proxmox/proxmox/ssh/client_notwindows.go
Brian ccf4834c16
feat(provider): add support for ssh-agent on Windows (#1270)
* feat(provider): add support for `ssh-agent` on Windows

Signed-off-by: Brian Karshick <Sparta142@users.noreply.github.com>
2024-05-09 23:00:44 -04:00

25 lines
481 B
Go

//go:build !windows
package ssh
import (
"errors"
"fmt"
"net"
)
// dialSocket dials a Unix domain socket.
func dialSocket(address string) (net.Conn, error) {
if address == "" {
return nil, errors.New("failed connecting to SSH agent socket: the socket file is not defined, " +
"authentication will fall back to password")
}
conn, err := net.Dial("unix", address)
if err != nil {
return nil, fmt.Errorf("error dialing unix socket: %w", err)
}
return conn, nil
}