Hello everyone, I am building kratos from source a...
# talk-kratos
m
Hello everyone, I am building kratos from source and installed kratos. Then I tried to migrate to Cockroachdb with command
kratos migrate sql
with the connection string
<cockroach://user1:password@192.168.xx.xxx:5432/auth?sslmode=verify-full>
. I am getting the below error
Copy code
WARN[2022-10-29T11:48:49-07:00] Unable to open database, retrying.            audience=application error=map[message:could not open database connection: failed to connect to `host=192.168.85.118 user=user1 database=auth`: failed to write startup message (x509: certificate is valid for 127.0.0.1, not <http://192.168.xx.xxx|192.168.xx.xxx>)] service_name=Ory Kratos service_version=master
Please let me know how to handle this. I tested other ways to connect to the Cockroachdb securely (golang code, psql) and it works. Update 1: with dns set to
<cockroach://user1:password@192.168.xx.xxx:5432/auth>
without sslmode it works.
r
Not sure how cockroach works, but I am assuming you can connect using 127.0.0.1
m
It worked when the
sslmode
is disabled. I think the certificate is preventing and not sure how to fix it. For time being, the sslmode is kept off
r
The error message is useful here:
certificate is valid for 127.0.0.1, not <http://192.168.xx.xxx|192.168.xx.xxx>
CockroachDB is presenting a certificate for 127.0.0.1, but you are connecting to 192.168.xx.xx.
Probably, you need to configure cockroach to listen on 192.168.xx.xx.
Or issue a new certificate valid for 192.168.xx.xx.
depending on how you generated/configured the certificate CockroachDB is presenting
m
Thanks @refined-kangaroo-48640. I am going to fix the crdb certificate and try.