Skip to content

"Could not load the client key from..." on 2.2.0 #1242

Description

@nowakca

Software versions
MySqlConnector version:
Server type (MySQL, MariaDB, Aurora, etc.) and version: MySQL 8.0.29-21 (per show variables like ‘%version%’;)
.NET version: 6.0.8 (as reported by [environment]::Version in Powershell 7.2.6)
(Optional) ORM NuGet packages and versions:

Describe the bug

When I attempt to connect to a MySQL database using a certificate for authentication, I get the below exception. (variables substituted in to avoid exposing info). This works normally in 2.1.13, but not 2.2.0.

Exception
MethodInvocationException: Exception calling "Open" with "0" argument(s): "Could not load the client key from $KEYPATH"

Code sample

$connectionString = "ConvertZeroDateTime=True;SslMode=VerifyCA;host=$HOSTNAME;user=$USERNAME;SslKey=$KEYPATH;port=3306;database=grmp;SslCa=$CAPATH;SslCert=$CERTPATH;AllowLoadLocalInfile=True"
$conn = [MySqlConnector.MySqlConnection]::New($connectionString)
$conn.open()

Expected behavior
I expected to get a populated connection record.

Additional context
This works as expected on 2.1.13, it only started failing on 2.2.0. My test containers were built within a minute of each other, with the only difference being the MySqlConnector version... both had same access to the key. So the issue seems to be how 2.2.0 is parsing the key, not its access to the key or changes in OS libraries.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions