@@ -1514,7 +1514,7 @@ void AssertException(Exception exception)
1514
1514
AssertTlsWithoutClientCertOnWindows ( exception ) ;
1515
1515
break ;
1516
1516
case OperatingSystemPlatform . Linux :
1517
- AssertInnerEncryptionException ( exception , Type . GetType ( "Interop + Crypto + OpenSslCryptographicException , System . Net . Security " , throwOnError : true ) , " Authentication failed , see inner exception . " , "SSL Handshake failed with OpenSSL error - SSL_ERROR_SSL." ) ;
1517
+ AssertTlsWithoutClientCertOnLinux ( exception ) ;
1518
1518
break ;
1519
1519
case OperatingSystemPlatform . MacOS :
1520
1520
AssertInnerEncryptionException ( exception , Type . GetType ( "Interop+ AppleCrypto+ SslException , System . Net . Security ", throwOnError: true) , "Authentication failed , see inner exception. ", "handshake failure") ;
@@ -1554,7 +1554,7 @@ void AssertException(Exception exception)
1554
1554
AssertTlsWithoutClientCertOnWindows( exception) ;
1555
1555
break ;
1556
1556
case OperatingSystemPlatform. Linux:
1557
- AssertInnerEncryptionException ( exception , Type . GetType ( "Interop+Crypto+OpenSslCryptographicException, System.Net.Security" , throwOnError : true ) , "Authentication failed, see inner exception." , "SSL Handshake failed with OpenSSL error - SSL_ERROR_SSL." ) ;
1557
+ AssertTlsWithoutClientCertOnLinux ( exception) ;
1558
1558
break ;
1559
1559
case OperatingSystemPlatform. MacOS:
1560
1560
AssertInnerEncryptionException( exception, Type. GetType( "Interop+AppleCrypto+SslException, System.Net.Security" , throwOnError : true) , "Authentication failed, see inner exception." , "handshake failure" ) ;
@@ -1592,7 +1592,7 @@ void AssertException(Exception exception)
1592
1592
AssertTlsWithoutClientCertOnWindows ( exception ) ;
1593
1593
break ;
1594
1594
case OperatingSystemPlatform . Linux :
1595
- AssertInnerEncryptionException ( exception , Type . GetType ( "Interop+Crypto+OpenSslCryptographicException, System.Net.Security" , throwOnError : true ) , "Authentication failed, see inner exception." , "SSL Handshake failed with OpenSSL error - SSL_ERROR_SSL." ) ;
1595
+ AssertTlsWithoutClientCertOnLinux ( exception ) ;
1596
1596
break ;
1597
1597
case OperatingSystemPlatform . MacOS :
1598
1598
AssertInnerEncryptionException ( exception , Type . GetType ( "Interop+AppleCrypto+SslException, System.Net.Security" , throwOnError : true ) , "Authentication failed, see inner exception." , "handshake failure" ) ;
@@ -1630,7 +1630,7 @@ void AssertException(Exception exception)
1630
1630
AssertTlsWithoutClientCertOnWindows ( exception ) ;
1631
1631
break ;
1632
1632
case OperatingSystemPlatform . Linux :
1633
- AssertInnerEncryptionException ( exception , Type . GetType ( "Interop+Crypto+OpenSslCryptographicException, System.Net.Security" , throwOnError : true ) , "Authentication failed, see inner exception." , "SSL Handshake failed with OpenSSL error - SSL_ERROR_SSL." ) ;
1633
+ AssertTlsWithoutClientCertOnLinux ( exception ) ;
1634
1634
break ;
1635
1635
case OperatingSystemPlatform . MacOS :
1636
1636
AssertInnerEncryptionException ( exception , Type . GetType ( "Interop+AppleCrypto+SslException, System.Net.Security" , throwOnError : true ) , "Authentication failed, see inner exception." , "handshake failure" ) ;
@@ -1665,6 +1665,29 @@ void AssertCertificate(bool? isExpired, bool? invalidHost)
1665
1665
isInvalidHost . Should ( ) . Be ( invalidHost ) ;
1666
1666
}
1667
1667
1668
+ void AssertTlsWithoutClientCertOnLinux ( Exception exception )
1669
+ {
1670
+ try
1671
+ {
1672
+ AssertInnerEncryptionException (
1673
+ exception ,
1674
+ Type . GetType ( "Interop+Crypto+OpenSslCryptographicException, System.Net.Security" , throwOnError : true ) ,
1675
+ "Authentication failed, see inner exception." ,
1676
+ "SSL Handshake failed with OpenSSL error - SSL_ERROR_SSL." ) ;
1677
+ }
1678
+ catch ( XunitException )
1679
+ {
1680
+ // With Tls1.3, there is no report of a failed handshake if the client certificate verification fails
1681
+ // since the client receives a 'Finished' message from the server before sending its certificate, it assumes
1682
+ // authentication and we will not know if there was an error until we next read/write from the server.
1683
+ AssertInnerEncryptionException < SocketException > (
1684
+ exception ,
1685
+ async
1686
+ ? "Unable to read data from the transport connection: Connection reset by peer."
1687
+ : "Unable to write data to the transport connection: Connection reset by peer." ) ;
1688
+ }
1689
+ }
1690
+
1668
1691
void AssertTlsWithoutClientCertOnWindows ( Exception exception )
1669
1692
{
1670
1693
try
0 commit comments