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

Viewed 2062

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

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).

Related