Skip to content
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

Backport of #5895: Fix typo in akka.remote.dot-netty.ssl.certificate #5903

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/core/Akka.Remote/Configuration/Remote.conf
Expand Up @@ -555,13 +555,13 @@ akka {

# To use a Thumbprint instead of a file, set this to true
# And specify a thumprint and it's storage location below
use-thumprint-over-file = false
use-thumbprint-over-file = false

# Valid Thumprint required (if use-thumbprint-over-file is true)
# A typical thumbprint is a format similar to: "45df32e258c92a7abf6c112e54912ab15bbb9eb0"
# On Windows machines, The thumprint for an installed certificate can be located
# By using certlm.msc and opening the certificate under the 'Details' tab.
thumpbrint = ""
thumbprint = ""

# The Store name. Under windows The most common option is "My", which indicates the personal store.
# See System.Security.Cryptography.X509Certificates.StoreName for other common values.
Expand Down
Expand Up @@ -292,11 +292,17 @@ internal sealed class SslSettings
public static SslSettings Create(Config config)
{
if (config.IsNullOrEmpty())
throw new ConfigurationException($"Failed to create {typeof(DotNettyTransportSettings)}: DotNetty SSL HOCON config was not found (default path: `akka.remote.dot-netty.Ssl`)");
throw new ConfigurationException($"Failed to create {typeof(DotNettyTransportSettings)}: DotNetty SSL HOCON config was not found (default path: `akka.remote.dot-netty.ssl`)");

if (config.GetBoolean("certificate.use-thumprint-over-file", false))
if (config.GetBoolean("certificate.use-thumprint-over-file", false)
|| config.GetBoolean("certificate.use-thumbprint-over-file", false))
{
return new SslSettings(config.GetString("certificate.thumbprint", null),
var thumbprint = config.GetString("certificate.thumbprint", null)
?? config.GetString("certificate.thumpbrint", null);
if (string.IsNullOrWhiteSpace(thumbprint))
throw new Exception("`akka.remote.dot-netty.ssl.certificate.use-thumbprint-over-file` is set to true but `akka.remote.dot-netty.ssl.certificate.thumbprint` is null or empty");

return new SslSettings(thumbprint,
config.GetString("certificate.store-name", null),
ParseStoreLocationName(config.GetString("certificate.store-location", null)),
config.GetBoolean("suppress-validation", false));
Expand Down Expand Up @@ -366,7 +372,7 @@ public SslSettings(string certificateThumbprint, string storeName, StoreLocation
if (find.Count == 0)
{
throw new ArgumentException(
"Could not find Valid certificate for thumbprint (by default it can be found under `akka.remote.dot-netty.tcp.ssl.certificate.thumpbrint`. Also check akka.remote.dot-netty.tcp.ssl.certificate.store-name and akka.remote.dot-netty.tcp.ssl.certificate.store-location)");
"Could not find Valid certificate for thumbprint (by default it can be found under `akka.remote.dot-netty.tcp.ssl.certificate.thumbprint`. Also check `akka.remote.dot-netty.tcp.ssl.certificate.store-name` and `akka.remote.dot-netty.tcp.ssl.certificate.store-location`)");
}

Certificate = find[0];
Expand Down