@@ -1247,6 +1247,8 @@ private async Task InitSslAsync(ProtocolCapabilities serverCapabilities, Connect
1247
1247
catch ( Exception ex )
1248
1248
{
1249
1249
Log . Error ( ex , "Session{0} couldn't load CA certificate from CertificateFile '{1}'" , m_logArguments ) ;
1250
+ if ( ! File . Exists ( cs . CACertificateFile ) )
1251
+ throw new MySqlException ( "Cannot find CA Certificate File: " + cs . CACertificateFile , ex ) ;
1250
1252
throw new MySqlException ( "Could not load CA Certificate File: " + cs . CACertificateFile , ex ) ;
1251
1253
}
1252
1254
@@ -1265,9 +1267,7 @@ private async Task InitSslAsync(ProtocolCapabilities serverCapabilities, Connect
1265
1267
catch ( CryptographicException ex )
1266
1268
{
1267
1269
m_logArguments [ 1 ] = cs . CACertificateFile ;
1268
- Log . Error ( ex , "Session{0} couldn't load CA certificate from CertificateFile '{1}'" , m_logArguments ) ;
1269
- if ( ! File . Exists ( cs . CACertificateFile ) )
1270
- throw new MySqlException ( "The CA Certificate File is invalid" , ex ) ;
1270
+ Log . Warn ( ex , "Session{0} couldn't load CA certificate from CertificateFile '{1}'" , m_logArguments ) ;
1271
1271
}
1272
1272
index = nextIndex ;
1273
1273
}
@@ -1469,7 +1469,7 @@ X509CertificateCollection LoadCertificate(string sslKeyFile, string sslCertifica
1469
1469
Log . Error ( ex , "Session{0} couldn't load client key from KeyFile '{1}'" , m_logArguments ) ;
1470
1470
if ( ! File . Exists ( sslCertificateFile ) )
1471
1471
throw new MySqlException ( "Cannot find client certificate file: " + sslCertificateFile , ex ) ;
1472
- throw new MySqlException ( "Could not load the client key from " + sslKeyFile , ex ) ;
1472
+ throw new MySqlException ( "Could not load the client key from " + sslCertificateFile , ex ) ;
1473
1473
}
1474
1474
#else
1475
1475
m_clientCertificate = X509Certificate2 . CreateFromPemFile ( sslCertificateFile , sslKeyFile ) ;
@@ -1559,7 +1559,7 @@ static void ReadRow(ReadOnlySpan<byte> span, out int? connectionId, out byte[]?
1559
1559
}
1560
1560
catch ( MySqlException ex )
1561
1561
{
1562
- Log . Error ( ex , "Session{0} failed to get CONNECTION_ID(), VERSION()" , m_logArguments ) ;
1562
+ Log . Info ( ex , "Session{0} failed to get CONNECTION_ID(), VERSION()" , m_logArguments ) ;
1563
1563
}
1564
1564
}
1565
1565
0 commit comments