Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

806 B
Raw Blame
package security

import (
	"crypto/tls"

	"github.com/seaweedfs/seaweedfs/weed/security/certreload"
	"google.golang.org/grpc/credentials/tls/certprovider"
)

// NewReloadingServerCertificate returns a GetCertificate callback for
// tls.Config.GetCertificate, backed by a refreshing pem provider so
// rotated certs (e.g. from Kubernetes cert-manager) are picked up
// without a restart.
//
// Thin wrapper over certreload; the shared implementation lives in the
// subpackage so both server TLS (this package) and HTTP client TLS
// (weed/util/http/client) can use it without an import cycle.
func NewReloadingServerCertificate(certFile, keyFile string) (func(*tls.ClientHelloInfo) (*tls.Certificate, error), certprovider.Provider, error) {
	return certreload.NewServerGetCertificate(certFile, keyFile)
}