importer-exporter icon indicating copy to clipboard operation
importer-exporter copied to clipboard

Support SSL connections

Open bstroebl opened this issue 5 years ago • 6 comments

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

bstroebl avatar Dec 05 '18 08:12 bstroebl

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.

FxKu avatar Dec 05 '18 18:12 FxKu

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.

bstroebl avatar Dec 06 '18 06:12 bstroebl

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

clausnagel avatar Dec 06 '18 08:12 clausnagel

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.

chenkianwee avatar Jul 17 '20 21:07 chenkianwee

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.

clausnagel avatar Sep 18 '20 22:09 clausnagel

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

chenkianwee avatar Oct 16 '20 19:10 chenkianwee