reload certs from disk upon SIGHUP (#13792)

This commit is contained in:
Harshavardhana
2021-12-01 00:38:32 -08:00
committed by GitHub
parent b280a37c4d
commit 24d904d194
3 changed files with 9 additions and 0 deletions

View File

@@ -34,6 +34,7 @@ import (
"sort"
"strconv"
"strings"
"syscall"
"time"
fcolor "github.com/fatih/color"
@@ -718,6 +719,10 @@ func getTLSConfig() (x509Certs []*x509.Certificate, manager *certs.Manager, secu
}
}
secureConn = true
// syscall.SIGHUP to reload the certs.
manager.ReloadOnSignal(syscall.SIGHUP)
return x509Certs, manager, secureConn, nil
}

View File

@@ -40,6 +40,7 @@ import (
"sort"
"strings"
"sync"
"syscall"
"time"
"github.com/dustin/go-humanize"
@@ -597,6 +598,7 @@ func NewGatewayHTTPTransportWithClientCerts(clientCert, clientKey string) *http.
err.Error()))
}
if c != nil {
c.ReloadOnSignal(syscall.SIGHUP) // allow reloads upon SIGHUP
transport.TLSClientConfig.GetClientCertificate = c.GetClientCertificate
}
}