Bug #87638 missing ; in .net file-based certificate example ...
Submitted: 1 Sep 2017 9:38 Modified: 3 Sep 2017 15:27
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / NET Documentation Severity:S3 (Non-critical)
Version: OS:Microsoft Windows
Assigned to: CPU Architecture:Any

[1 Sep 2017 9:38] Shane Bester
Description:
On the page
https://dev.mysql.com/doc/connector-net/en/connector-net-tutorials-ssl.html

the code example under "Connecting to the server using a file-based certificate"
is missing a semi colon after the pfx, so this code will crash with:

An unhandled exception of type 'System.Security.Cryptography.CryptographicException' occurred in MySql.Data.dll

Additional information: The system cannot find the file specified.

How to repeat:
As it is in the docs,  connector will try to open a file called:

H:\git\mysql-trunk\mysql-test\std_data\client.pfxCertificatePassword=pass

Suggested fix:
using (MySqlConnection connection = new MySqlConnection(
  "database=test;user=sslclient;" +
  "CertificateFile=H:\\git\\mysql-trunk\\mysql-test\\std_data\\client.pfx;" +
  "CertificatePassword=pass;" +
  "SSL Mode=Required "))
{
    connection.Open();
}
[3 Sep 2017 15:27] Christine Cole
Posted by developer:
 
The code example was fixed as recommended.

Thank you for the correction.