Configuring aerospike metricbeat module with TLS

I am looking at the code

and trying to figure out how I should configure TLS certificates to get access to the aerospike service endpoint with TLS configured.

Does anybody have a successful module configuration example for this?

I tried

   - module: aerospike
     metricsets: ["namespace"]
     enabled: true
     period: 10s
     hosts: ["localhost:3000"]
     ssl.certificate: /my_aerospike_certs/cert.pem
     ssl.key: /my_aerospike_certs/key.pem
     ssl.certificate_authorities: /my_aerospike_certs/ca.pem

but I keep getting this error read: connection reset by peer

Not sure when these ssl. are being applied in the module code

Thanks for any help

Looking at the elastic code implementation and the aerospike client api,
this functionality is not implemented.
It should be something like this:

	serverCertPool, clientCertPool := readCertificates(*serverCertDir, *clientCertFile, *clientKeyFile)

	clientPolicy := as.NewClientPolicy()

	if len(*tlsName) > 0 || *encryptOnly == true {
		// Setup TLS Config
		tlsConfig := &tls.Config{
			Certificates:             clientCertPool,
			RootCAs:                  serverCertPool,
			InsecureSkipVerify:       *encryptOnly,
			PreferServerCipherSuites: true,

		clientPolicy.TlsConfig = tlsConfig

	client, err := as.NewClientWithPolicy(clientPolicy, *host, *port)
	if err != nil {
		log.Fatalln("Failed to connect to the server cluster: ", err)

	log.Println("Connection successful. Discovered nodes:", client.Cluster().GetNodes())

Hi @sentient would you mind open a PR for this? It will be very appreciated. Thanks!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.