简体   繁体   English

Npgsql错误:System.IO.IOException

[英]Npgsql error: System.IO.IOException

I am trying to use Npgsql to use database connections with C# asp.net, but I get an error code whenever I run some code with a connection in it. 我正在尝试使用Npgsql在C#asp.net中使用数据库连接,但是每当我运行带有连接的代码时,我都会得到一个错误代码。

    An exception of type 'System.IO.IOException' occurred in Npgsql.dll but was not handled in user code

    Additional information: TlsClientStream.ClientAlertException: CertificateExpired

   at TlsClientStream.TlsClientStream.SendAlertFatal(AlertDescription description, String message)

   at TlsClientStream.TlsClientStream.ParseCertificateMessage(Byte[] buf, Int32& pos)

   at TlsClientStream.TlsClientStream.TraverseHandshakeMessages()

   at TlsClientStream.TlsClientStream.GetInitialHandshakeMessages(Boolean allowApplicationData)

   at TlsClientStream.TlsClientStream.PerformInitialHandshake(String hostName, X509CertificateCollection clientCertificates, RemoteCertificateValidationCallback remoteCertificateValidationCallback, Boolean checkCertificateRevocation)

I've used the Npgsql installer and tried with just referencing it,but nothing works,what am I missing? 我使用了Npgsql安装程序,并尝试仅引用它,但没有任何效果,我缺少什么? I am working in a school project so there is nothing wrong with the code, its something with my Npgsql. 我在一个学校的项目中工作,所以代码没有问题,这与我的Npgsql有关。

Thanks in advance. 提前致谢。

您始终可以尝试使用:连接字符串中的Trust Server Certificate = True

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

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