Not able to enable Cluster encryption

I am trying to enable cluster encryption using command,
“/opt/couchbase/bin/couchbase-cli node-to-node-encryption -c localhost -u user -p password --enable” but getting error ERROR: Failed to reach otp port 21150 for node ‘ns_1@cb.local’. Failed to establish TLS connection to TLS handshake failure (TLS client: In state wait_cert_cr at ssl_handshake.erl:2084 generated CLIENT ALERT: Fatal - Handshake Failure

  • {bad_cert,hostname_check_failed})*.

Note: I am using single node Couchbase container.

It would be great if someone could explain to me what is happening here and provide a solution. Please let me know if you need any further information.

Failed to establish TLS connection to

Sounds like the cluster configuration is using the ip address (, while the certificate probably uses the hostname.