简体   繁体   中英

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.

    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? I am working in a school project so there is nothing wrong with the code, its something with my Npgsql.

Thanks in advance.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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