Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npgsql driver sslmode missing verify-ca and verify-full -- PostgreSql

As per links below, PostgreSql supports several ssl mode connections, but its ADO.net driver, npgsql does not support the modes verify-ca and verify-full, which are supported by the its JDBC driver.

Is there any reason for this? Is it possible to use these modes somehow else?

PostgreSql docu https://www.postgresql.org/docs/9.1/libpq-ssl.html

Npgsql driver docu https://www.npgsql.org/doc/connection-string-parameters.html

JDBC driver docu https://jdbc.postgresql.org/documentation/head/ssl-client.html

like image 693
Destro Avatar asked Oct 23 '25 04:10

Destro


1 Answers

Npgsql will by default verify the server certificate, so SSL Mode=Require would correspond to libpq's verify-ca or verify-full (the documentation is not entirely clear on that).

From the documentation link in your question:

By default, Npgsql will validate your server's certificate; if you're using a self-signed certificate, this will fail. You can instruct Npgsql to ignore this by specifying Trust Server Certificate=true in the connection string. To precisely control how the server's certificate is validated, you can register UserCertificateValidationCallback on NpgsqlConnection (this works just like on .NET's SslStream).

like image 186
Laurenz Albe Avatar answered Oct 24 '25 18:10

Laurenz Albe



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!