mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-05-18 17:37:46 +08:00
Merge pull request #1693 from jedevc/remote-tls-missing-key-cert
remote: avoid tls error if both key and cert are not set
This commit is contained in:
commit
948414e1b2
@ -98,12 +98,12 @@ func (f *factory) New(ctx context.Context, cfg driver.InitConfig) (driver.Driver
|
|||||||
if tls.caCert == "" {
|
if tls.caCert == "" {
|
||||||
missing = append(missing, "cacert")
|
missing = append(missing, "cacert")
|
||||||
}
|
}
|
||||||
if tls.cert == "" {
|
if tls.cert != "" && tls.key == "" {
|
||||||
missing = append(missing, "cert")
|
|
||||||
}
|
|
||||||
if tls.key == "" {
|
|
||||||
missing = append(missing, "key")
|
missing = append(missing, "key")
|
||||||
}
|
}
|
||||||
|
if tls.key != "" && tls.cert == "" {
|
||||||
|
missing = append(missing, "cert")
|
||||||
|
}
|
||||||
if len(missing) > 0 {
|
if len(missing) > 0 {
|
||||||
return nil, errors.Errorf("tls enabled, but missing keys %s", strings.Join(missing, ", "))
|
return nil, errors.Errorf("tls enabled, but missing keys %s", strings.Join(missing, ", "))
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user