【问题标题】:Reverse enginerring PostgreSQL database with SSL connection in SchemaSpy在 SchemaSpy 中使用 SSL 连接对 PostgreSQL 数据库进行逆向工程
【发布时间】:2014-07-19 19:12:22
【问题描述】:

运行 SchemaSpy 时出现错误:

由于以下错误,连接失败:“主机“xxx.xxx.xxx.xxx”、用户“xxxx”、数据库“xxx”、SSL 关闭没有 pg_hba.conf 条目”

发生错误是因为数据库确实需要 SSL 连接。

有没有办法在 SchemaSpy 中为连接打开 SSL 标志,我打开了 jar 文件但找不到任何东西。我知道 PostgreSQL JDBC 驱动支持 SSL,所以理论上应该是可以的。

否则,如果有人知道任何开源/免费软件工具可以通过 SSL 连接对 postgresql 数据库进行逆向工程,那将有很大帮助。

谢谢。

【问题讨论】:

    标签: database postgresql ssl er-diagrams schemaspy


    【解决方案1】:

    这样做:

    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 参数)并且我们正在询问客户端(即driver) 无条件接受 SSL 连接(sslfactory 参数)。

    【讨论】:

      【解决方案2】:

      根据the PgJDBC documentation,在您的网址参数中使用ssl=true 选项,例如

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

      如果主机没有有效证书或证书与其主机名不匹配,您可以disable SSL validation too

      SchemaSpy 接受用于连接的 JDBC URL,因此可以正常工作。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-09-30
        • 2014-11-07
        • 1970-01-01
        相关资源
        最近更新 更多