ssh/tailssh: handle session recording when running in userspace mode

Previously it would dial out using the http.DefaultClient, however that doesn't work
when tailscaled is running in userspace mode (e.g. when testing).

Updates tailscale/corp#9967

Signed-off-by: Maisem Ali <maisem@tailscale.com>
This commit is contained in:
Maisem Ali
2023-03-23 14:47:04 -07:00
committed by Maisem Ali
parent df89b7de10
commit 583e86b7df
2 changed files with 30 additions and 3 deletions

View File

@ -237,6 +237,10 @@ var (
testSignerOnce sync.Once
)
func (ts *localState) Dialer() *tsdial.Dialer {
return nil
}
func (ts *localState) GetSSH_HostKeys() ([]gossh.Signer, error) {
testSignerOnce.Do(func() {
_, priv, err := ed25519.GenerateKey(rand.Reader)