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
feat(remote): add support for custom certificate validation callbacks (#686)
* feat(remote): add support for custom certificate validation callbacks from Akka.NET v1.5.55
- Updated Akka.NET from v1.5.53 to v1.5.55 to access new SSL/TLS features
- Added CustomValidator property to SslOptions to support CertificateValidationCallback
- Updated RemoteOptions.Build to use appropriate DotNettySslSetup constructor based on settings:
- 5-parameter constructor when CustomValidator is provided (v1.5.55+)
- 4-parameter constructor when RequireMutualAuthentication or ValidateCertificateHostname is set
- 2-parameter constructor for legacy scenarios (backward compatibility)
- Added comprehensive test coverage for CustomValidator configuration
- Updated API approval tests to reflect new public API surface
This enhancement allows users to implement custom certificate validation logic such as:
- Certificate pinning
- Subject/issuer matching
- Business-specific validation rules
- Advanced mTLS scenarios
The implementation maintains full backward compatibility while providing access to the powerful
new CertificateValidation features introduced in Akka.NET v1.5.55.
* Fix SSL configuration precedence issue
Fixed bug where both HOCON SSL configuration and DotNettySslSetup were being emitted simultaneously. DotNettySslSetup ALWAYS takes precedence when present, making HOCON SSL settings ineffective and potentially confusing.
Changes:
- Modified RemoteOptions.Build to only emit HOCON SSL config when X509Certificate is null
- Added comprehensive comments explaining SSL configuration strategy with link to Akka.NET issue #7914
- Updated tests to use CertificateOptions instead of X509Certificate when testing HOCON SSL configuration
- Both WithRemotingNewSslSettingsHoconTest and WithRemotingConfiguratorNewSslSettingsTest now properly test HOCON config
This ensures users understand that:
1. X509Certificate object → DotNettySslSetup (programmatic, takes precedence)
2. X509Certificate null + SSL settings → HOCON configuration only
Related to: akkadotnet/akka.net#7914
* Add comprehensive SSL/TLS documentation with CustomValidator examples
Added detailed SSL/TLS configuration documentation to Akka.Remote.Hosting README including:
- Basic SSL configuration with certificate file (HOCON-based)
- SSL configuration with X509Certificate2 object (programmatic)
- Advanced custom certificate validation example (certificate pinning)
- Examples using all CertificateValidation helper methods from Akka.NET v1.5.55:
* ValidateChain() - Standard chain validation
* ValidateHostname() - Hostname validation
* PinnedCertificate() - Certificate pinning
* ValidateSubject() - Subject pattern matching
* ValidateIssuer() - Issuer validation
* Combine() - Combining multiple validators
- Complete SSL configuration options reference
- Important note about DotNettySslSetup vs HOCON precedence
This helps users understand how to use the new CustomValidator feature for enhanced security scenarios.
* Simplify SSL/TLS documentation to single example
Copy file name to clipboardExpand all lines: src/Akka.Remote.Hosting/README.md
+36Lines changed: 36 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,3 +52,39 @@ using var host = new HostBuilder()
52
52
53
53
awaithost.RunAsync();
54
54
```
55
+
56
+
## SSL/TLS Configuration
57
+
58
+
Akka.Remote supports SSL/TLS encryption for secure communication between actor systems. Starting with Akka.NET v1.5.55, you can provide custom certificate validation callbacks using the `CertificateValidation` helper class.
Available `CertificateValidation` methods: `ValidateChain()`, `ValidateHostname()`, `PinnedCertificate()`, `ValidateSubject()`, `ValidateIssuer()`, and `Combine()`.
0 commit comments