From c8daccbd5e9e76320b2f85da39a5580940058a34 Mon Sep 17 00:00:00 2001 From: Ross Brattain Date: Mon, 26 Dec 2022 20:42:32 -0500 Subject: [PATCH] tls: fix typo, use clientCertSearchPath for clientcert.pem (#940) `clientcert.pem` is located in `/etc/pki/libvirt/clientcert.pem` as per https://www.libvirt.org/tlscerts.html Fixes ```go level=error msg="Error: failed to dial libvirt: can't locate resource 'clientcert.pem' in [/home/kni/.pki/libvirt /etc/pki/libvirt/private]: file does not exist" ``` --- libvirt/uri/tls.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libvirt/uri/tls.go b/libvirt/uri/tls.go index f17b97103..29fb7c8ad 100644 --- a/libvirt/uri/tls.go +++ b/libvirt/uri/tls.go @@ -81,7 +81,7 @@ func (u *ConnectionURI) tlsConfig() (*tls.Config, error) { // non-root also looks in $HOME/.pki first if !root { caCertSearchPath = append([]string{os.ExpandEnv(defaultUserPKIPath)}, caCertSearchPath...) - clientCertSearchPath = append([]string{os.ExpandEnv(defaultUserPKIPath)}, clientKeySearchPath...) + clientCertSearchPath = append([]string{os.ExpandEnv(defaultUserPKIPath)}, clientCertSearchPath...) clientKeySearchPath = append([]string{os.ExpandEnv(defaultUserPKIPath)}, clientKeySearchPath...) } }