Merge pull request #1693 from jedevc/remote-tls-missing-key-cert

remote: avoid tls error if both key and cert are not set
pull/1698/head
Tõnis Tiigi 2 years ago committed by GitHub
commit 948414e1b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -98,12 +98,12 @@ func (f *factory) New(ctx context.Context, cfg driver.InitConfig) (driver.Driver
if tls.caCert == "" {
missing = append(missing, "cacert")
}
if tls.cert == "" {
missing = append(missing, "cert")
}
if tls.key == "" {
if tls.cert != "" && tls.key == "" {
missing = append(missing, "key")
}
if tls.key != "" && tls.cert == "" {
missing = append(missing, "cert")
}
if len(missing) > 0 {
return nil, errors.Errorf("tls enabled, but missing keys %s", strings.Join(missing, ", "))
}

Loading…
Cancel
Save