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",
})
}
我在 /etc/falco/certs 位置使用 openssl 生成了证书。在运行程序时,我收到此错误。
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
如何解决这个问题?