mirror of
https://github.com/adnanh/webhook.git
synced 2025-10-04 13:41:03 +00:00
Reload TLS key pair on HUP signal
This commit is contained in:
parent
1c72898604
commit
50a690a5e4
3 changed files with 34 additions and 0 deletions
|
@ -112,6 +112,11 @@ func (s *Service) SetTLSEnabled() {
|
|||
s.enableTLS = true
|
||||
}
|
||||
|
||||
// TLSEnabled return true if TLS is enabled for the service.
|
||||
func (s *Service) TLSEnabled() bool {
|
||||
return s.enableTLS
|
||||
}
|
||||
|
||||
// SetTLSKeyPair sets the TLS key pair for the service.
|
||||
func (s *Service) SetTLSKeyPair(certPath, keyPath string) error {
|
||||
if certPath == "" {
|
||||
|
@ -132,6 +137,11 @@ func (s *Service) SetTLSKeyPair(certPath, keyPath string) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// ReloadTLSKeyPair attempts to reload the configured TLS certificate key pair.
|
||||
func (s *Service) ReloadTLSKeyPair() error {
|
||||
return s.kpr.Reload()
|
||||
}
|
||||
|
||||
// SetTLSMinVersion sets the minimum support TLS version, such as "v1.3".
|
||||
func (s *Service) SetTLSMinVersion(ver string) (err error) {
|
||||
s.tlsMinVersion, err = security.GetTLSVersion(ver)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue