Skip to content

Commit

Permalink
Fix typo in akka.remote.dot-netty.ssl.certificate (#5903)
Browse files Browse the repository at this point in the history
(cherry picked from commit 5146559)
  • Loading branch information
Arkatufus committed Apr 29, 2022
1 parent 7cf5c96 commit 520a4af
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
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

0 comments on commit 520a4af

Please sign in to comment.