Browse Source

Fix Tailscale

master
Jan-Lukas Else 3 weeks ago
parent
commit
9225370967
  1. 3
      httpListener.go
  2. 7
      tailscale.go

3
httpListener.go

@ -25,8 +25,9 @@ func (a *goBlog) getTCPListener(s *http.Server) (net.Listener, error) {
if err != nil {
return nil, err
}
tailscaleLC := &tailscale.LocalClient{}
return tls.NewListener(ln, &tls.Config{
GetCertificate: tailscale.GetCertificate,
GetCertificate: tailscaleLC.GetCertificate,
MinVersion: tls.VersionTLS12,
}), nil
} else {

7
tailscale.go

@ -8,7 +8,6 @@ import (
"os"
"path/filepath"
"tailscale.com/client/tailscale"
"tailscale.com/tsnet"
)
@ -45,10 +44,14 @@ func (a *goBlog) getTailscaleListener(addr string) (net.Listener, error) {
if err != nil {
return nil, err
}
lc, err := a.tss.LocalClient()
if err != nil {
return nil, err
}
// Tailscale HTTPS
if addr == ":443" && a.cfg.Server.TailscaleHTTPS {
ln = tls.NewListener(ln, &tls.Config{
GetCertificate: tailscale.GetCertificate,
GetCertificate: lc.GetCertificate,
MinVersion: tls.VersionTLS12,
})
}

Loading…
Cancel
Save