ellie-commons / sequeler

SQL Client built in Vala
GNU General Public License v3.0
804 stars 66 forks source link

Support unencrypted connections #327

Closed chronitis closed 4 years ago

chronitis commented 4 years ago

libgda supports a USE_SSL param for both MySQL and Postgres connections, which is currently not surfaced in sequeler.

This adds a switch for SSL to the connection dialog, and appends it to the connection string for these databases. It defaults to on for the upgrade case where it is unset (TODO: whether this is the correct behaviour).

The motivating case is working with databases on both internal and external networks where control over this is useful.

I haven't worked with Vala before. This might require some iterations.

chronitis commented 4 years ago

This works (in the sense that it adds a control and appends the result to the connection string), but doesn't actually solve my root problem, which would appear to be a libgda issue that attempting to connect to a MySQL server where SSL is supported but you don't want to use it, the USE_SSL parameter is not respected. It looks like sequeler was actually defaulting to no SSL in any case - I misinterpreted libgda behaviour here.

(The concrete case is that AWS RDS MySQL 5.6 supports SSL, but only TLS 1.0, which recent Debian/Ubuntu disables, so attempted connections fail with an openssl unsupported protocol error even if USE_SSL=false is included in the connection string).

Alecaddd commented 4 years ago

Thanks for working on this. Did you make any progress? Can I help in any way?

chronitis commented 4 years ago

So, as noted this doesn't actually solve my problem, and a quick dig into the libgda source didn't either (my guess: it has lots of strange overrides for running DDL/DML commands, which might include the SSL mode). This is definitely not a sequeler issue - I can replicate it by using the gda-sql cli which ships with the library.

However, if you think this would be a useful feature in general, I can finish it. I think the only outstanding issues are that the default case should be SSL off, and that the switch added to the connection dialog currently gets stretched to the width of the text inputs and looks terrible.

Alecaddd commented 4 years ago

Yeah, let's finish this feature. I'll deal with the UI issues during review. Unfortunately, many limitations and issues of Sequeler are caused by LibGDA. I hope the next release will come soon with lots of improvements.