I want to connect to my postgres databases using the dbcrossbar packages. So I'd connect to my database using the code below. This works perfectly fine. However, when using dbcrossbar I seem to have errors connecting and I have no idea how this can occur.
psql -h localhost -d my_db -U postgres
psql -h <server_ip> -d my_db2 -U postgres
The dbcrossbar code is as follows:
1)
dbcrossbar cp \
--if-exists=overwrite \
--schema=postgres-sql:table.sql \
csv:"my_csv.csv" \
'postgres://postgres@localhost:5432/my_db#my_table'
2)
dbcrossbar cp \
--if-exists=overwrite \
--schema=postgres-sql:table.sql \
csv:"my_csv.csv" \
'postgres://postgres@<server_ip>:5432/my_db#my_table'
The first piece of code connecting to localhost gived me the error (hostname mismatch) and the second piece of code connecting to the server gives the error (unable to get local issuer certificate). To solve it I already looked at SSL Error: unable to get local issuer certificate but could not find the problem. Here I tried openssl s_client -connect <server>:<port>
and for both methods it outputs Verify OK (0), so everything seems to be working. I think it has to do something with my setup, as this issue is not found on the dbcrossbar github, what could be the issue when receiving such errors?
complete output:
1)
Error: could not connect to PostgreSQL
caused by: error performing TLS handshake: error:0A000086:SSL routines:tls_post_process_server_certificate:certificate verify failed:../ssl/statem/statem_clnt.c:1883: (hostname mismatch)
2)
Error: could not connect to PostgreSQL
caused by: error performing TLS handshake: error:0A000086:SSL routines:tls_post_process_server_certificate:certificate verify failed:../ssl/statem/statem_clnt.c:1883: (unable to get local issuer certificate)