-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix TLS handshake error handling #7839
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
Fix TLS handshake error handling #7839
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some questions and some definite must-do changes.
src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveRemote.DotNet.verified.txt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very clean, very simple. Well done.
Assert.Contains("TLS handshake failed", msg, StringComparison.OrdinalIgnoreCase); | ||
|
||
// Server should shutdown due to TLS failure | ||
await AwaitAssertAsync(async () => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
||
namespace Akka.Remote.Transport.DotNetty | ||
{ | ||
internal sealed class TlsHandshakeFailureReason : CoordinatedShutdown.Reason |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
$"TLS handshake failed on channel [{context.Channel.LocalAddress}->{context.Channel.RemoteAddress}](Id={context.Channel.Id})")); | ||
// Shutdown the ActorSystem on TLS handshake failure | ||
var cs = CoordinatedShutdown.Get(Transport.System); | ||
cs.Run(new TlsHandshakeFailureReason($"TLS handshake failed on channel [{context.Channel.LocalAddress}->{context.Channel.RemoteAddress}](Id={context.Channel.Id})")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* Fix TLS handshake error handling * Simplify PR * Simplify PR, remove new DisassociateInfo * Clean whitespace noise * cleanup, remove TlsHandshakeErrorAssociation (cherry picked from commit 1ec6f9e)
Fixes #7838
Enforce ActorSystem shutdown on TLS handshake failures
Summary
Changes
TlsHandshakeCompletionEvent
failures inTcpTransport
and runCoordinatedShutdown
using a newTlsHandshakeFailureReason
(exit code 79). Logs include channel endpoints and id.New shutdown reason
Akka.Remote.Transport.DotNetty.TlsHandshakeFailureReason
(exit code 79): used byTcpTransport
andEndpointManager
to terminate the misconfigured system.Tests (Akka.Remote.Tests)
Tls_handshake_failure_should_be_logged_and_shutdown_server
Server_side_tls_handshake_failure_should_shutdown_server
Client_side_tls_handshake_failure_should_shutdown_client
Rationale
Impact / Migration