Problem Description
Using SSL while configuring Aerospike Prometheus exporter is causing error:aerospike-prometheus-exporter: time="2023-12-19T09:28:45Z" level=error msg="ResultCode: NETWORK_ERROR, Iteration: 0, InDoubt: false, Node: <nil>: network error.Following error can be seen in the wrapped content:
ntls: failed to verify certificate: x509: certificate relies on legacy Common Name field, use SANs instead
Explanation
Pre-requisite to install Aerospike Prometheus Exporter is to install Go v1.17+ and from Go v1.15, the use of Common Name (CN) is deprecated and has been replaced with Subject Alternative Name (SAN).The deprecated, legacy behavior of treating the
CommonName field on X.509 certificates as a host name when no Subject Alternative Names are present is now disabled by default. This is causing the Network error.