Page 1 of 1
SSL - Resource can't be load
Posted: Sun 24 Jan 2010 16:22
by Zero-G.
Hey
Using the lates version of your dotConnet for mySQL
I have added my SSL files to the projects and set the build to embedded resource.
In VB.NET (version 2008) I use the following code:
Code: Select all
.Protocol = Devart.Data.MySql.MySqlProtocol.Ssl
.SslOptions.CACert = "resource://ca-cert"
I also tried the whole name: resource://ca-cert.pem
But doesn't work as well
The error Message I get is:
"Resource ID ca-cert: resource not found."
StackTrace:
" bei Devart.Security.af.d(String A_0) bei Devart.Common.ak.f(String A_0)"
Posted: Tue 26 Jan 2010 13:26
by Shalex
Please add your project name to the name of your resource:
Code: Select all
.SslOptions.CACert = "resource://MyProject.ca-cert.pem"
Posted: Tue 26 Jan 2010 20:51
by Zero-G.
Hey
Thanks for the tip. But there seems to be one more problem.
I use my SSL Certificates with mySQL Administrator and also with Maestro's mySQL. - Both programs are able to connect with my SSL-Secured mySQL Server
When I use the same SSL-Certificates as embedded resource in my program(Resource://... changed as you provided in the last post), then I get the following error
"SSL connection error (2026): Verification check of remote certificate failed."
StackTrace:
bei Devart.Data.MySql.v.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, ProxyOptions A_9, MySqlHttpOptions A_10, HttpOptions A_11)
bei Devart.Data.MySql.MySqlInternalConnection.Connect(String userId, String password, String host, String database, Int32 port, Int32 connectionTimeout, MySqlProtocol protocol, Boolean compress, Boolean clientInteractive)
bei Devart.Data.MySql.MySqlInternalConnection..ctor(p connectionOptions)
bei Devart.Data.MySql.as.a(v A_0, Object A_1, DbConnectionBase A_2)
bei Devart.Common.DbConnectionFactory.a(DbConnectionPool A_0, v A_1)
bei Devart.Common.DbConnectionPoolGroup.c(DbConnectionPool A_0)
bei Devart.Common.DbConnectionPool.a()
bei Devart.Common.DbConnectionPool.GetObject(DbConnectionBase owningConnection)
bei Devart.Common.DbConnectionFactory.a(DbConnectionBase A_0)
bei Devart.Common.DbConnectionClosed.Open(DbConnectionBase outerConnection)
bei Devart.Common.DbConnectionBase.Open()
bei Devart.Data.MySql.MySqlConnection.Open()
bei VOPT.mySQL.isAvailable() in C:\Users\Intelli Soft\Documents\Visual Studio 2008\Projects\Visual OPT .NET - Kopie\Vopt\VOPT\Klasse\clsBefehle.vb:Zeile 536.
The code I use:
Code: Select all
With _Connection
.ConnectionString = GetConnectionString()
.Protocol = Devart.Data.MySql.MySqlProtocol.Ssl
.SslOptions.CACert = "resource://VOPT.ca-cert.pem"
.SslOptions.Cert = "resource://VOPT.client-cert.pem"
.SslOptions.Key = "resource://VOPT.client-key.pem"
End With
What could this be? - As I said above, I use the same Certificates!
THX[/quote]
Posted: Wed 27 Jan 2010 14:48
by Shalex
We cannot reproduce the issue in our environment. The program works correctly with our test certificates in both cases: either they are set as files in the system ("file://D:\ca-cert.pem") or as compiled resources ("resource://MyNamespace.ca.pem"). Please tell us:
1) is there any inner exception when the error occurs?
2) does your code work if you set your certificates as files in the system?