mirror of
https://github.com/bpg/terraform-provider-proxmox.git
synced 2025-06-29 18:21:10 +00:00
* feat(provider): add support for `ssh-agent` on Windows Signed-off-by: Brian Karshick <Sparta142@users.noreply.github.com>
25 lines
481 B
Go
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
|
|
}
|