3dcitydb / importer-exporter

3D City Database client for high-performance import and export of 3D city model data
Apache License 2.0
126 stars 53 forks source link

Support SSL connections #70

Open bstroebl opened 5 years ago

bstroebl commented 5 years ago

My PostGIS database uses ssl for any connection, the importer tries to connect with SSL off and I did not find a setting to configure ssl. I am using Importer/Exporter version 4.0.0

FxKu commented 5 years ago

Sounds like a good idea to add this feature. But, it's hard for me to estimate how much time it takes to implement it. Do you have some experience with SSL and JDBC clients?

For Postgres, I've found this wiki page For Oracle it probably works with this.

bstroebl commented 5 years ago

Hallo Felix, not really, all I know is that this JDBC string connects with my PostgreSQL instance via SSL: java.sql.DriverManager.getConnection("jdbc:postgresql://myserver:5432/mydb?ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory", "myuser", "mypassword") Regarding Postgres the parameter sslmode might be interesting to offer as a choice to the user.

clausnagel commented 5 years ago

Agree that support for SSL connections sounds like a very useful thing to have. Well, I also lack experience with SSL support in the current PostgreSQL and Oracle JDBC drivers.

Below you find SSL options offered by pgAdmin (anything besides SSL mode is optional). Maybe this is a good starting point. However, SSL compression seems to require a specific implementation of a SSLSocketFactory. Not sure whether this is available in the default JDBC driver.

Well, anyways, contribution is very welcome :-)

pgadmin-ssl

chenkianwee commented 4 years ago

Hi I am wondering if there is any update or workaround about this issue? I am trying to use 3Dcitydb and setting it up on a homeserver with docker. However I would like to be able to update my database on a client computer using the import/export tool. However, I am unable to connect to my server through ssl. Thanks.

clausnagel commented 3 years ago

Hi @chenkianwee, unfortunately we have not found the time to work on this so far, sorry. Still hoping for contribution.

What you could try is to hardcode your SSL settings into the JDBC connection string of the Importer/Exporter. For PostgreSQL/PostGIS, this connection string is returned by the method getJDBCUrl of the class PostGISAdapter (see here). So maybe adding the connection parameters from your above post helps to connect to your database. After changing the code, you can easily build the Importer/Exporter using this guideline.

Not a perfect solution, I know. But maybe a workaround.

chenkianwee commented 3 years ago

Hi Thanks, will try it and see if it works.