Page 1 of 1

Invalid PEM Header?

Posted: Fri 24 Oct 2008 14:32
by csdev
Hi, I'm currently trying to use MySqlConnection (in MyDirect .NET 3.50.13) to create a secure connection to a MySQL 5.1 server. I'm currently able to do the same thing with no problems using either the MySQL client or their C++ library, but when using MyDirect, I receive an exception citing an 'Invalid PEM header.'

The contents of the stack trace are as follows:

Code: Select all

   at CoreLab.Security.a.a(Byte[] A_0, String& A_1, Byte[]& A_2)
   at CoreLab.Security.a.a(Byte[] A_0)
   at CoreLab.Security.a.b(String A_0)
   at CoreLab.Security.j.f(String A_0)
   at CoreLab.MySql.j.a(String A_0, String A_1)
   at CoreLab.MySql.b.a(String A_0, String A_1, String A_2, String A_3, Int32 A_4, String A_5, Int32 A_6, SshOptions A_7, SslOptions A_8)
   at CoreLab.MySql.MySqlInternalConnection.Connect(String userId, String password, String host, String database, Int32 port, Int32 connectionTimeout, MySqlProtocol protocol, Boolean compress)
   at CoreLab.MySql.MySqlInternalConnection..ctor(ac connectionOptions)
   at CoreLab.MySql.a7.a(DbConnectionOptions A_0, Object A_1, DbConnectionBase A_2)
   at CoreLab.Common.DbConnectionFactory.a(DbConnectionPool A_0, DbConnectionOptions A_1)
   at CoreLab.Common.DbConnectionPool.a()
   at CoreLab.Common.DbConnectionPool.GetObject()
   at CoreLab.Common.DbConnectionFactory.a(DbConnectionBase A_0)
   at CoreLab.Common.DbConnectionClosed.Open(DbConnectionBase outerConnection)
   at CoreLab.MySql.MySqlConnection.Open()
ConnectToRemoteDatabase() <-- My function
I used OpenSSL to generate the files (server and clients share the same CA, but not certificates or common names). Does anyone know why MyDirect wouldn't like certain PEM-encoded certificates and keys?

Posted: Mon 27 Oct 2008 09:04
by Shalex
We cannot reproduce this problem with the *.PEM files you have sent us.

Please provide us with the settings you are using:
1) the SslOptions.CACert, SslOptions.Cert, SslOptions.Key properties of the MySqlConnection object in your code;
2) the values of the following MySQL server variables: 'ssl-ca','ssl-cert' and 'ssl-key'.

Please refer to , section "Using MyDirect .NET", part "Using Secure Connections".