Hello,
I use MyDirect.NET2 Mobile for database access on a windows mobile 6 device. Now, I tried to make connections secure using SSL instead of plain text. The problem is, that I get always "Lost connection to MySQL server during query" when MySqlConnection.open() is called.
For testing purposes, I downloaded the dotConnect for MySQL 5.00 Professional Trial and created an application using the same sourc code and the same cert files and there it works fine, so the MySQL server setup and the certificates are correct.
I guess the problem is simply, that I don't know what paths should be specified for the cert files on the windows mobile device.
On windows XP, I used
connection.SslOptions.CACert = "file://C:\ca-cert.pem"
connection.SslOptions.Cert = "file:///C:\client-cert.pem"
connection.SslOptions.Key = "file:///C:\client-key.pem"
and it works. But what path should be used on mobile devices since there is no drive C there? It seems that it does not work to use relative paths like ...CACert = "file://\ca-cert.pem" instead.
Thank you for your help.
SSL problem on windows mobile
I tried some "file://" strings today and found the following:
file://\cacert.pem ==> exception: the pem file could not be found
file://\cacert.pem ==> exception: lost connection...; inner exception: an error occurs while reading from the file
file://\asdf.pem (invalid filename) ==> exception: lost connection...; inner exception: an error occurs while raeding from the file
file://\cacert.pem ==> exception: lost connection...; inner exception: nothing
file://\asdf.pem (invalid filename) ==> exception: an error occurs while reading from the file; inner exception: the file asdf.pem cannot be found.
file://cacert.pem ==> exception: lost connection...; inner exception: nothing
conclusion: file://\cacert.pem seems to be correct for windows mobile devices, a second \ is not required (no inner exception there); file://cacert.pem seems also to be valid. Nevertheless, I still get the "lost connection" exception and I don't find any reason for this.
As I already mentioned, the problem only occurs on the windows mobile device, it works fine on windows XP.
Is there anything else I could try to get this working?
file://\cacert.pem ==> exception: the pem file could not be found
file://\cacert.pem ==> exception: lost connection...; inner exception: an error occurs while reading from the file
file://\asdf.pem (invalid filename) ==> exception: lost connection...; inner exception: an error occurs while raeding from the file
file://\cacert.pem ==> exception: lost connection...; inner exception: nothing
file://\asdf.pem (invalid filename) ==> exception: an error occurs while reading from the file; inner exception: the file asdf.pem cannot be found.
file://cacert.pem ==> exception: lost connection...; inner exception: nothing
conclusion: file://\cacert.pem seems to be correct for windows mobile devices, a second \ is not required (no inner exception there); file://cacert.pem seems also to be valid. Nevertheless, I still get the "lost connection" exception and I don't find any reason for this.
As I already mentioned, the problem only occurs on the windows mobile device, it works fine on windows XP.
Is there anything else I could try to get this working?