我想使用DBCROSSBAR软件包连接到Postgres数据库。因此,我将使用以下代码连接到数据库。这很好。但是,当使用DBCROSSBAR时,我似乎有错误连接,我不知道会发生这种情况。
psql -h localhost -d my_db -U postgres
psql -h <server_ip> -d my_db2 -U postgres
DBCROSSBAR代码如下:
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'
连接到Localhost的第一条代码GIEDS ME错误(主机名不匹配),连接到服务器的第二件代码给出了错误(无法获得本地发行者证书)。为了解决它,我已经看过,但找不到问题。在这里,我尝试了 openssl s_client -connect&lt;:&lt; port&gt;
,并且对于这两种方法,它都输出验证OK(0),因此一切似乎都在起作用。我认为这必须使用我的设置做点事,因为在DBCrossbar Github上找不到这个问题,在收到此类错误时可能会有什么问题?
完整输出:
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)
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)
发布评论