Skip to content

Commit

Permalink
Backport Teleport Connect gateway changes from #11720 (#12297)
Browse files Browse the repository at this point in the history
#11720 was backported to v9, but at that time Teleport Connect wasn't
backported to v9, so the changes to gateway.go were dropped.

This PR reintroduces them, as without that part it's not possible to open
db connections when running Teleport Connect from the v9 branch.
  • Loading branch information
ravicious authored Apr 29, 2022
1 parent 6b0e7ec commit a8f2cb7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/teleterm/gateway/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package gateway

import (
"context"
"crypto/tls"
"fmt"
"net"
"strconv"
Expand Down Expand Up @@ -70,13 +71,19 @@ func New(cfg Config) (*Gateway, error) {
return nil, trace.Wrap(err)
}

cert, err := tls.LoadX509KeyPair(cfg.CertPath, cfg.KeyPath)
if err != nil {
return nil, trace.Wrap(err)
}

localProxy, err := alpn.NewLocalProxy(alpn.LocalProxyConfig{
InsecureSkipVerify: cfg.Insecure,
RemoteProxyAddr: cfg.WebProxyAddr,
Protocol: protocol,
Listener: listener,
ParentContext: closeContext,
SNI: address.Host(),
Certs: []tls.Certificate{cert},
})
if err != nil {
return nil, trace.Wrap(err)
Expand Down

0 comments on commit a8f2cb7

Please sign in to comment.