func newFileBackedCertificateFromBaseDir(mtlsRootPath string, serviceIdentity string) (*FileBackedCertificate, error) {
certDirectory := path.Join(mtlsRootPath, serviceIdentity)
+ logger.V(2).Debugf("trying to load identity %q from root path %q", serviceIdentity, certDirectory)
+
leafPath := path.Join(certDirectory, "cert.pem")
chainPath := path.Join(certDirectory, "chain.pem")
keyPath := path.Join(certDirectory, "privkey.pem")
for _, file := range []string{leafPath, chainPath, keyPath, rootPath} {
if err := fsutil.FileExistsAndIsReadable(file); err != nil {
+ logger.V(2).Errorf("cannot load identity %q from %s: error reading file %q: %v", serviceIdentity, certDirectory, file, err)
return nil, err
}
}
func LoadSSLCertificateFromFilesystem(certName string) (*FileBackedCertificate, error) {
certDirectory := path.Join(sslCertsBaseDir, certName)
+ logger.V(2).Debugf("trying to load ssl cert %q from root path %q", certName, certDirectory)
+
leafPath := path.Join(certDirectory, "cert.pem")
chainPath := path.Join(certDirectory, "chain.pem")
keyPath := path.Join(certDirectory, "privkey.pem")
for _, file := range []string{leafPath, chainPath, keyPath, rootPath} {
if err := fsutil.FileExistsAndIsReadable(file); err != nil {
+ logger.V(2).Errorf("cannot load ssl cert %q from %s: error reading file %q: %v", certName, certDirectory, file, err)
return nil, err
}
}