You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix DotNettySslSetup being ignored when HOCON has valid SSL config (#7918) (#7919)
* Add failing test to expose DotNettySslSetup override bug (#7917)
Added test case that demonstrates DotNettySslSetup settings being ignored
when HOCON has valid certificate configuration. The test configures:
- HOCON with valid certificate path and settings
- DotNettySslSetup with different certificate and settings
Expected: DotNettySslSetup should take precedence (programmatic over config)
Actual: HOCON certificate is used, DotNettySslSetup is completely ignored
The bug occurs because CreateOrDefault() tries HOCON first and only uses
the programmatic setup as an exception fallback. This test fails and
will pass once the fix is applied to make programmatic setup take precedence.
Existing tests didn't catch this because they only test the exception-based
fallback path (HOCON with enable-ssl=true but no certificate path).
* Fix DotNettySslSetup being ignored when HOCON has valid SSL config (#7917)
Changed SSL settings initialization to prioritize programmatic DotNettySslSetup
over HOCON configuration, fixing the precedence order bug.
Changes:
- Modified DotNettyTransportSettings.Create() to check sslSettings (from
DotNettySslSetup) first before parsing HOCON configuration
- Changed SslSettings.Create() from private to internal to enable direct usage
- Previous behavior: HOCON always tried first, programmatic setup only used
as exception fallback
- New behavior: Programmatic setup takes precedence, HOCON used if not provided
This ensures programmatic configuration properly overrides HOCON defaults,
which is the expected behavior for Setup-based configuration in Akka.NET.
The bug existed since DotNettySslSetup was introduced in July 2023
(commit 588d5d6). Existing tests passed only because they triggered
the exception-based fallback path (HOCON with enable-ssl=true but no
certificate path).
thrownewConfigurationException($"Failed to create {typeof(DotNettyTransportSettings)}: DotNetty SSL HOCON config was not found (default path: `akka.remote.dot-netty.tcp.ssl`)");
0 commit comments