spring.datasource.driver-class-name = org.postgresql.Driver
spring.datasource.url = jdbc:postgresql://127.0.0.1:5432/pg?useSSL=false&serverTimezone=UTC
spring.datasource.username = username
spring.datasource.password = password
spring.datasource.driver-class-name = org.postgresql.Driver
spring.datasource.url = jdbc:postgresql://127.0.0.1:5432/pg?ssl=true&sslrootcert=/postgres_ssl/root.crt&sslkey=/postgres_ssl/postgresql.key.der&sslcert=/postgres_ssl/postgresql.crt&&sslmode=verify-ca
spring.datasource.username = username
spring.datasource.password = password
如果是本地启动的话,crt是无法直接被java读取的,要转化成,pem文件
使用命令在liunx服务器里面使用
openssl x509 -in www.x.com.crt -out www.x.com.pem
.key文件转化为.key.der 文件
openssl pkcs8 -topk8 -inform PEM -in my.key -outform DER -nocrypt -out my.key.der
将转化完成的证书导入java本地的证书里面
1.右键cmd,以管理员身份打开
2.cd C:\Program Files\Java\jdk1.8.0_162\bin ,(目的是为了使用keytool)
3.keytool -import -keystore "C:\\Program Files\\Java\\jdk1.8.0_162\\jre\\lib\\security\\cacerts" -file "C:\\Users\\123\\Desktop\\pem\\ca-minio.pem" -alias myMinioKey
(这里把pem证书放在桌面的pem文件夹中)