Could not obtain the handle of the public key

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
Worker13
Posts: 1
Joined: Tue 01 Oct 2019 12:32

Could not obtain the handle of the public key

Post by Worker13 » Tue 01 Oct 2019 12:36

If i try to connect to an postgres-server with dotconnect, i got already the following exception:

Devart.Data.PostgreSql.PgSqlException: Could not obtain the handle of the public key. ---> Devart.Security.r: Could not obtain the handle of the public key.
bei Devart.Security.SSL.ai.a(IAsyncResult A_0)
bei Devart.Security.SSL.w.a(Byte[] A_0, Int32 A_1, Int32 A_2)
bei Devart.Common.p.d(Byte[] A_0, Int32 A_1, Int32 A_2)
bei Devart.Data.PostgreSql.ag.ag()
bei Devart.Data.PostgreSql.ag.a()
bei Devart.Common.DbConnectionFactory.a(DbConnectionBase A_0)
bei Devart.Common.DbConnectionClosed.Open(DbConnectionBase outerConnection)
bei Devart.Common.DbConnectionBase.Open()
bei Devart.Data.PostgreSql.PgSqlConnection.Open()

What can i do there?
I tried to check the permission - but these are already set.
This problem is occurred in Windows10.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Could not obtain the handle of the public key

Post by Shalex » Fri 04 Oct 2019 18:36

1. Is the error constant or intermittent?

2. Please try to localize the issue. For this, create a simple Console App (.NET Framework) and run:

Code: Select all

  // case (a)
  var conn = new PgSqlConnection("user id=...;password=...;host=...;database=...;");
  conn.SslOptions.CACert = "E:\\Test\\root.crt";
  conn.SslOptions.Cert = "E:\\Test\\client.crt";
  conn.SslOptions.Key = "E:\\Test\\client.key";
  conn.SslOptions.SslMode = SslMode.Require;
  conn.Open();

  // case (b)
  var conn = new PgSqlConnection("user id=...;password=...;host=...;database=...;");
  conn.SslOptions.SslMode = SslMode.Require;
  conn.Open();
2.1. Do (a) and (b) work?

2.2. If (a) and (b) throw exceptions different to "Could not obtain the handle of the public key.", specify their full stack traces.

JIC: https://www.devart.com/dotconnect/postg ... tions.html

Post Reply