0

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.

1
  • 1
    Additional information: TlsClientStream.ClientAlertException: CertificateExpired sounds like you have an invalid certificate on the server. If this is for a school project, maybe you don't need to use encryption on your connections. Commented Mar 7, 2016 at 16:38

1 Answer 1

0

You can always try to use: Trust Server Certificate=True in your connection string

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.