@@ -1247,6 +1247,8 @@ private async Task InitSslAsync(ProtocolCapabilities serverCapabilities, Connect
12471247 catch ( Exception ex )
12481248 {
12491249 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 ) ;
12501252 throw new MySqlException ( "Could not load CA Certificate File: " + cs . CACertificateFile , ex ) ;
12511253 }
12521254
@@ -1265,9 +1267,7 @@ private async Task InitSslAsync(ProtocolCapabilities serverCapabilities, Connect
12651267 catch ( CryptographicException ex )
12661268 {
12671269 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 ) ;
12711271 }
12721272 index = nextIndex ;
12731273 }
@@ -1469,7 +1469,7 @@ X509CertificateCollection LoadCertificate(string sslKeyFile, string sslCertifica
14691469 Log . Error ( ex , "Session{0} couldn't load client key from KeyFile '{1}'" , m_logArguments ) ;
14701470 if ( ! File . Exists ( sslCertificateFile ) )
14711471 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 ) ;
14731473 }
14741474#else
14751475 m_clientCertificate = X509Certificate2 . CreateFromPemFile ( sslCertificateFile , sslKeyFile ) ;
@@ -1559,7 +1559,7 @@ static void ReadRow(ReadOnlySpan<byte> span, out int? connectionId, out byte[]?
15591559 }
15601560 catch ( MySqlException ex )
15611561 {
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 ) ;
15631563 }
15641564 }
15651565
0 commit comments