[英]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.