- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1.1k
Improve TLS/SSL certificate error messages during handshake failures #7891
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Merged
      
      
            Aaronontheweb
  merged 4 commits into
  akkadotnet:dev
from
Aaronontheweb:feature/enhance-tls-error-messages
  
      
      
   
  Oct 9, 2025 
      
    
                
     Merged
            
            Improve TLS/SSL certificate error messages during handshake failures #7891
                    Aaronontheweb
  merged 4 commits into
  akkadotnet:dev
from
Aaronontheweb:feature/enhance-tls-error-messages
  
      
      
   
  Oct 9, 2025 
              
            Conversation
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
    …kkadotnet#7890) Added TlsErrorMessageBuilder helper class to provide human-readable error messages for TLS certificate validation failures. Enhanced error messages now include: - Detailed SSL policy error interpretations - X509 chain status diagnostics with actionable suggestions - Certificate details (subject, issuer, thumbprint, validity dates) - Role-specific troubleshooting guidance (client vs server) Updated certificate validation callback in mutual TLS to use enhanced error messages. Added TLS exception handling in TcpHandlers to detect and report AuthenticationException and CryptographicException with detailed diagnostics. All existing TLS tests continue to pass.
Upgraded mutual TLS validation errors from Warning to Error level for better visibility. Enhanced error messages now cover all TLS failure scenarios: Server-side mutual TLS validation: - No client certificate provided: detailed error with troubleshooting steps - Client certificate validation failures: comprehensive chain validation diagnostics Client-side and general handshake failures: - Added enhanced error diagnostics to UserEventTriggered for TlsHandshakeCompletionEvent - Improved client-side troubleshooting guidance including certificate trust chain requirements - Both client and server TLS exceptions now include role-specific troubleshooting All error messages provide actionable suggestions and certificate details to aid in diagnosis.
      
        
      
      
  
    5 tasks
  
    
  Aaronontheweb 
      added a commit
        to Aaronontheweb/akka.net
      that referenced
      this pull request
    
      Oct 9, 2025 
    
    
      
  
    
      
    
  
…kkadotnet#7891) * Improve TLS/SSL certificate error messages during handshake failures (akkadotnet#7890) Added TlsErrorMessageBuilder helper class to provide human-readable error messages for TLS certificate validation failures. Enhanced error messages now include: - Detailed SSL policy error interpretations - X509 chain status diagnostics with actionable suggestions - Certificate details (subject, issuer, thumbprint, validity dates) - Role-specific troubleshooting guidance (client vs server) Updated certificate validation callback in mutual TLS to use enhanced error messages. Added TLS exception handling in TcpHandlers to detect and report AuthenticationException and CryptographicException with detailed diagnostics. All existing TLS tests continue to pass. * Enhance TLS error logging across all handshake scenarios Upgraded mutual TLS validation errors from Warning to Error level for better visibility. Enhanced error messages now cover all TLS failure scenarios: Server-side mutual TLS validation: - No client certificate provided: detailed error with troubleshooting steps - Client certificate validation failures: comprehensive chain validation diagnostics Client-side and general handshake failures: - Added enhanced error diagnostics to UserEventTriggered for TlsHandshakeCompletionEvent - Improved client-side troubleshooting guidance including certificate trust chain requirements - Both client and server TLS exceptions now include role-specific troubleshooting All error messages provide actionable suggestions and certificate details to aid in diagnosis.
      
     Merged
  
    
  Aaronontheweb 
      added a commit
      that referenced
      this pull request
    
      Oct 10, 2025 
    
    
      
  
    
      
    
  
…7891) * Improve TLS/SSL certificate error messages during handshake failures (#7890) Added TlsErrorMessageBuilder helper class to provide human-readable error messages for TLS certificate validation failures. Enhanced error messages now include: - Detailed SSL policy error interpretations - X509 chain status diagnostics with actionable suggestions - Certificate details (subject, issuer, thumbprint, validity dates) - Role-specific troubleshooting guidance (client vs server) Updated certificate validation callback in mutual TLS to use enhanced error messages. Added TLS exception handling in TcpHandlers to detect and report AuthenticationException and CryptographicException with detailed diagnostics. All existing TLS tests continue to pass. * Enhance TLS error logging across all handshake scenarios Upgraded mutual TLS validation errors from Warning to Error level for better visibility. Enhanced error messages now cover all TLS failure scenarios: Server-side mutual TLS validation: - No client certificate provided: detailed error with troubleshooting steps - Client certificate validation failures: comprehensive chain validation diagnostics Client-side and general handshake failures: - Added enhanced error diagnostics to UserEventTriggered for TlsHandshakeCompletionEvent - Improved client-side troubleshooting guidance including certificate trust chain requirements - Both client and server TLS exceptions now include role-specific troubleshooting All error messages provide actionable suggestions and certificate details to aid in diagnosis.
      
     Merged
  
  This was referenced Oct 10, 2025 
      
  This was referenced Oct 15, 2025 
      
      
        
      
      
  
    8 tasks
  
  This was referenced Oct 27, 2025 
      
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
      
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Summary
Resolves #7890 by providing human-readable, actionable error messages for TLS/SSL certificate validation failures.
Changes
Added TlsErrorMessageBuilder helper class (
DotNettyTransportSettings.cs):SslPolicyErrorsto detailed explanationsX509ChainStatusFlagswith specific troubleshooting suggestionsEnhanced server-side mutual TLS validation (
DotNettyTransport.cs):Enhanced TLS exception handling (
TcpTransport.cs):UserEventTriggeredforTlsHandshakeCompletionEventfailuresExceptionCaughtto detect and reportAuthenticationExceptionandCryptographicExceptionUpdated test expectations:
Test Results
All existing TLS tests pass:
Example Enhanced Error Output
Before:
After:
Benefits