-
Notifications
You must be signed in to change notification settings - Fork 636
Description
I installed the operator and created a cluster named 'master' with basically default configuration:
apiVersion: postgres-operator.crunchydata.com/v1beta1
kind: PostgresCluster
metadata:
name: master
namespace: persistence
spec:
config:
postgresVersion: 16
instances:
- name: instance1
replicas: 2
...
When I do a port-forward to localhost:5432 and try to connect with a Go application I get the following error
Error connecting to database: tls: failed to parse certificate from server: x509: SAN dNSName is malformed
I took a look in the the secret master-server-cert and then the tls.crt and found this:
X509v3 Subject Alternative Name:
DNS:master-primary.persistence.svc.cluster.local., DNS:master-primary.persistence.svc, DNS:master-primary.persistence, DNS:master-primary, DNS:master-replicas.persistence.svc.cluster.local., DNS:master-replicas.persistence.svc, DNS:master-replicas.persistence, DNS:master-replicas
All the names that terminate with a dot are illegal according to X.509 standard. It looks like the go client library does not like the certificate. Is this a bug or do I see this wrong?
Additionally: Is there an easy way to add hosts like "localhost" or "db.example.com" (for a TCPRoute) to the certificate?
Fun fact: I am able to access the database remotely (either port-forward or TCPRoute) from the Database-Client in Golang which is Java-based. Obviously Java is more relaxed than Go regarding the certificate.