简体   繁体   English

是否有.net驱动程序支持与PostgreSQL完全验证的SSL连接?

[英]Is there a .net driver that supports SSL connection with verify-full to PostgreSQL?

I am trying to connect to a PostgreSQL database using SSL. 我正在尝试使用SSL连接到PostgreSQL数据库。 The connection requires that SSLMode is verify-full, but the driver I use (from devart.com), supports Require as the highest level. 该连接要求SSLMode为完全验证,但我使用的驱动程序(来自devart.com)支持Require作为最高级别。

Is there a way to accomplish this using the latest driver from devart? 有没有办法使用devart的最新驱动程序来完成此任务? If not, is there any other driver that supports this? 如果不是,是否有其他驱动程序支持此功能?

I am able to connect using a native ODBC driver, so the connection works for native programs, but need a .Net driver to avoid importing ODBC libraries into my .NET application. 我能够使用本机ODBC驱动程序进行连接,因此该连接适用于本机程序,但是需要一个.Net驱动程序,以避免将ODBC库导入到我的.NET应用程序中。

Use nPgSQL with SSL=True;Sslmode=Require; nPgSQLSSL=True;Sslmode=Require; to enforce SSL. 强制执行SSL。 The enum doesn't seem to provide Verify , though (like in the JDBC driver) it might always verify unless overridden. 枚举似乎不提供Verify ,尽管(如在JDBC驱动程序中)它可能始终进行校验,除非被覆盖。 I don't have it around to test with. 我没有测试的地方。

If you need to you can provide a suitable CertificateValidationCallback to do a certificate verification using C# APIs yourself. 如果需要,您可以提供合适的CertificateValidationCallback来自己使用C#API进行证书验证。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM