I wrote a golang program which mTLS certs
package main
import (
"context"
"fmt"
"io"
"log"
"github.com/falcosecurity/client-go/pkg/api/outputs"
"github.com/falcosecurity/client-go/pkg/client"
"github.com/gogo/protobuf/jsonpb"
)
func main() {
// Set up a connection to the server.
c, err := client.NewForConfig(context.Background(), &client.Config{
Hostname: "localhost",
Port: 5060,
CertFile: "/etc/falco/certs/client.crt",
KeyFile: "/etc/falco/certs/client.key",
CARootFile: "/etc/falco/certs/ca.crt",
})
}
I generated certificates using openssl in the location /etc/falco/certs. On running the program Iam getting this error.
2021/10/21 11:58:22 unable to connect: error loading the X.509 key pair: open /etc/falco/certs/client.key: permission denied
exit status 1
How to fix this?