From 6c3df3c8cec0e3471bf1f3f02db51f6b14026e2d Mon Sep 17 00:00:00 2001 From: Daniel Jiang Date: Mon, 6 May 2019 11:14:39 +0800 Subject: [PATCH] Disable CA download when hosted via HTTP Signed-off-by: Daniel Jiang --- src/core/api/systeminfo.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/api/systeminfo.go b/src/core/api/systeminfo.go index 6b6456e42..140a688df 100644 --- a/src/core/api/systeminfo.go +++ b/src/core/api/systeminfo.go @@ -171,6 +171,7 @@ func (sia *SystemInfoAPI) GetGeneralInfo() { registryURL = l[0] } _, caStatErr := os.Stat(defaultRootCert) + enableCADownload := caStatErr == nil && strings.HasPrefix(extURL, "https://") harborVersion := sia.getVersion() info := GeneralInfo{ AdmiralEndpoint: utils.SafeCastString(cfg[common.AdmiralEndpoint]), @@ -182,7 +183,7 @@ func (sia *SystemInfoAPI) GetGeneralInfo() { SelfRegistration: utils.SafeCastBool(cfg[common.SelfRegistration]), ExtURL: extURL, RegistryURL: registryURL, - HasCARoot: caStatErr == nil, + HasCARoot: enableCADownload, HarborVersion: harborVersion, RegistryStorageProviderName: utils.SafeCastString(cfg[common.RegistryStorageProviderName]), ReadOnly: config.ReadOnly(),