Bug #71773 SSL Mode=Required in connection string throws TypeLoadException in .NETCF 2.0
Submitted: 19 Feb 2014 22:05 Modified: 27 Mar 2014 12:56
Reporter: David S Email Updates:
Status: Verified Impact on me:
Category:Connector / NET Severity:S2 (Serious)
Version:6.8.3 OS:Microsoft Windows (Window Mobile 6)
Assigned to: CPU Architecture:Any
Tags: encryption, SSL, TypeLoadException

[19 Feb 2014 22:05] David S
When I use "SSL Mode=Required" in my .NET Compact Framework connection string, I get a TypeLoadException whenever I try to use that connection on the device.  In the emulator, I get the following error: "Keyword not supported. Parameter name: SSL Mode"

As soon as I remove the SSL Mode parameter, everything works fine.

Note that I have tried in both .NET Compact Framework 2.0 and 3.5.  Also, I've tried using a SSL Mode in previous versions of the MySQL connector with the same error results.

How to repeat:
MySQL server 5.5 (x86) / Visual Studio 2008 / VB.NET / CF 2.0 SP2 / Connector/NET 6.8.3

Private test_conn As MySqlConnection = New MySqlConnection("server="testserver";user id=testuser;password=testpass;SSL Mode=Required;Connect Timeout=15;pooling=True;Max Pool Size=2;port=37475;persist security info=True;use procedure bodies=False;database=testtable")
[21 Feb 2014 15:45] Fernando Gonzalez.Sanchez
Thanks for your bug report.

Yes, Connector/NEt Internally uses System.Net.Security.SslStream to create the SSL channel.
This class doesn't exist in .NET Compact.
[21 Feb 2014 15:50] David S
Thank you for your reply.

Is there anyway to use SSL to encrypt the connection to a MySQL database in .NETCF?
[27 Feb 2014 15:44] David S
Any ideas?
[3 Mar 2014 14:40] Fernando Gonzalez.Sanchez
The third party library BouncyCastle has support for TLS (SSL) streams, it will take a while before it is shipped with Connector/NET (if is shipped) due to legal clearance having to be done.

Meanwhile I will try to post some sample code, you can include it yourself.
[3 Mar 2014 21:04] David S
Thank you, Fernando.
[27 Mar 2014 12:56] David S

Do you have any sample code on how the Bouncy Castle classes are implemented with the .NET connector?

[7 Dec 2015 18:05] Fernando Gonzalez.Sanchez
Hi, I am no longer in Connector/NET team, I will redirect this to one of the current team members.