简体   繁体   English

为什么我们在从 psql 连接到使用 ssl 保护的 postgres 服务器时不要求导入 server.crt

[英]why are we not asked to import server.crt while connecting from psql to postgres server secured using ssl

This is a very basic question.这是一个非常基本的问题。 i have to import the server.crt on the client side java trustore to connect using jdbc to postgres server secured by ssl.我必须在客户端 java trustore 上导入 server.crt 以使用 jdbc 连接到由 ssl 保护的 postgres 服务器。 But when i try psql from same machine, it shows the connection as encrypted.但是当我从同一台机器上尝试 psql 时,它显示连接是加密的。 How does psql import the server certificate? psql如何导入服务器证书?

psql "postgresql://$POSTGRES_HOST:$PG_PORT/postgres" -U postgres psql (9.6.18) SSL connection (protocol: TLSv1.2, cipher: ECDHE-RSA-AES256-GCM-SHA384, bits: 256, compression: off) Type "help" for help. psql "postgresql://$POSTGRES_HOST:$PG_PORT/postgres" -U postgres psql (9.6.18) SSL 连接(协议:TLSv1.2,密码:ECDHE-RSA-AES256-GCM-SHA384,位:256,压缩:关闭)键入“帮助”寻求帮助。

Regards, Shankar问候, 尚卡尔

You can use a cert to set up encryption, without verifying that the cert was signed by the correct authority.您可以使用证书来设置加密,而无需验证证书是否由正确的机构签署。 This is what psql does by default if there is no root.crt available and the sslmode is 'require' or below.如果没有可用的 root.crt 并且 sslmode 为 'require' 或更低,这就是 psql 默认执行的操作。

JDBC must be configured for, or default to, the equivalent of a sslmode above 'require'. JDBC 必须配置为或默认为“require”之上的等效 sslmode。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从本地服务器连接到 heroku psql 数据库 - 出现 ssl 错误 - Connecting to heroku psql database from local server - getting ssl error Postgres select 查询在使用 JDBC 时运行缓慢,但在 PSQL 中从同一服务器运行时运行速度很快 - Postgres select query runs slow when using JDBC but quick when running it in PSQL from the same server 通过 SSL 将 botpress 连接到外部 postgres 数据库服务器 - Connecting botpress to external postgres DB server over SSL 为什么在服务器上使用psql 9.2.4 - Why psql 9.2.4 on server 使用SSL连接到postgresql国外服务器出错 - Error connecting to postgresql foreign server using SSL 使用psql将.sql文件导入postgres - import .sql file into postgres using psql 从另一个Linux服务器连接Linux平台中的Postgres服务器 - Connecting a postgres server in linux platform from another linux server 为什么psql无法连接到服务器? - Why psql could not connect to server? 从 Digital Ocean 下载的 .crt CA 证书文件放在哪里,用于连接到其托管 PostgreSQL 服务器的 SSL - Where to put the .crt CA certificate file downloaded from Digital Ocean for a SSL connection to their Managed PostgreSQL server 来自 clickhouse 的 pSQL 连接时出错 - Error connecting while the pSQL from clickhouse
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM