mirror of
https://github.com/distribution/distribution.git
synced 2025-09-07 01:41:02 +00:00
Added support for specifying ACME-server by using REGISTRY_HTTP_TLS_LETSENCRYPT_DIRECTORYURL
Signed-off-by: Alex Lavallee <73203142+lavalleeale@users.noreply.github.com>
This commit is contained in:
committed by
Alex Lavallee
parent
6a57630cf4
commit
4bbe0ba080
@@ -188,6 +188,14 @@ func getCipherSuiteNames(ids []uint16) []string {
|
||||
return names
|
||||
}
|
||||
|
||||
// set ACME-server/DirectoryURL, if provided
|
||||
func setDirectoryURL(directoryurl string) *acme.Client {
|
||||
if len(directoryurl) > 0 {
|
||||
return &acme.Client{DirectoryURL: directoryurl}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// ListenAndServe runs the registry's HTTP server.
|
||||
func (registry *Registry) ListenAndServe() error {
|
||||
config := registry.config
|
||||
@@ -236,6 +244,7 @@ func (registry *Registry) ListenAndServe() error {
|
||||
Cache: autocert.DirCache(config.HTTP.TLS.LetsEncrypt.CacheFile),
|
||||
Email: config.HTTP.TLS.LetsEncrypt.Email,
|
||||
Prompt: autocert.AcceptTOS,
|
||||
Client: setDirectoryURL(config.HTTP.TLS.LetsEncrypt.DirectoryURL),
|
||||
}
|
||||
tlsConf.GetCertificate = m.GetCertificate
|
||||
tlsConf.NextProtos = append(tlsConf.NextProtos, acme.ALPNProto)
|
||||
|
Reference in New Issue
Block a user