1

When running SchemaSpy get error:

Connection failed because of the following error: "no pg_hba.conf entry for host "xxx.xxx.xxx.xxx", user "xxxx", database "xxx", SSL off"

The error occurs because the database does require an SSL connection.

Is there a way to turn on the SSL flag for a connection in SchemaSpy, I opened up the jar file but couldn't find anything. I know the PostgreSQL JDBC Driver supports SSL so this should be theoretically possible.

Otherwise if any one knows any opensource/freeware tools for reverse engineering a postgresql database with an SSL connections, that would help a lot.

Thanks.

4

2 回答 2

2

像这样做:

java -jar schemaSpy_5.0.0 -t pgsql -host your-host-url -db your-database-name -s your-database-schema -u your-username -p your-password -connprops "ssl\=true;sslfactory\ =org.postgresql.ssl.NonValidatingFactory" -o path-to-your-output-directory -dp path-to-your-jdbc-driver-jar-file

诀窍:使用-connprops选项添加一些附加参数:我们将 SSL 设置为 true(ssl参数)并且我们要求客户端(即驱动程序)无条件地接受 SSL 连接(sslfactory参数)。

于 2014-08-08T00:09:51.213 回答
0

根据PgJDBC 文档,使用ssl=trueURL 参数中的选项,例如

jdbc:postgresql://myhost/mydb?ssl=true

如果主机没有有效证书或证书与其主机名不匹配,您也可以禁用 SSL 验证

SchemaSpy 接受连接的 JDBC URL,所以这将正常工作。

于 2014-05-30T07:48:38.690 回答