Skip to content

Commit

Permalink
Fix typos (#4950)
Browse files Browse the repository at this point in the history
Signed-off-by: Terry Quigley <terry.quigley@sas.com>
  • Loading branch information
terryquigleysas authored Dec 5, 2024
1 parent 67f378a commit 4176478
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ SslContext buildServerSslContext(final boolean validateCertificates) {
.build()
);
} catch (PrivilegedActionException e) {
throw new OpenSearchException("Filed to build server SSL context", e);
throw new OpenSearchException("Failed to build server SSL context", e);
}
}

Expand All @@ -127,7 +127,7 @@ SslContext buildClientSslContext(final boolean validateCertificates) {
.build()
);
} catch (PrivilegedActionException e) {
throw new OpenSearchException("Filed to build client SSL context", e);
throw new OpenSearchException("Failed to build client SSL context", e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,15 @@ public synchronized void reloadSslContext(final CertType certType) {
private Map<CertType, SslConfiguration> loadConfigurations(final Environment environment) {
final var settings = environment.settings();
final var httpSettings = settings.getByPrefix(CertType.HTTP.sslConfigPrefix());
final var transpotSettings = settings.getByPrefix(CertType.TRANSPORT.sslConfigPrefix());
if (httpSettings.isEmpty() && transpotSettings.isEmpty()) {
final var transportSettings = settings.getByPrefix(CertType.TRANSPORT.sslConfigPrefix());
if (httpSettings.isEmpty() && transportSettings.isEmpty()) {
throw new OpenSearchException("No SSL configuration found");
}
jceWarnings();
openSslWarnings(settings);

final var httpEnabled = httpSettings.getAsBoolean(ENABLED, SECURITY_SSL_HTTP_ENABLED_DEFAULT);
final var transportEnabled = transpotSettings.getAsBoolean(ENABLED, SECURITY_SSL_TRANSPORT_ENABLED_DEFAULT);
final var transportEnabled = transportSettings.getAsBoolean(ENABLED, SECURITY_SSL_TRANSPORT_ENABLED_DEFAULT);

final var configurationBuilder = ImmutableMap.<CertType, SslConfiguration>builder();
if (httpEnabled && !clientNode(settings)) {
Expand All @@ -150,10 +150,10 @@ private Map<CertType, SslConfiguration> loadConfigurations(final Environment env
LOGGER.info("TLS HTTP Provider : {}", httpSslParameters.provider());
LOGGER.info("Enabled TLS protocols for HTTP layer : {}", httpSslParameters.allowedProtocols());
}
final var transportSslParameters = SslParameters.loader(transpotSettings).load(false);
final var transportSslParameters = SslParameters.loader(transportSettings).load(false);
if (transportEnabled) {
if (hasExtendedKeyUsageEnabled(transpotSettings)) {
validateTransportSettings(transpotSettings);
if (hasExtendedKeyUsageEnabled(transportSettings)) {
validateTransportSettings(transportSettings);
final var transportServerTrustAndKeyStore = new SslCertificatesLoader(
CertType.TRANSPORT.sslConfigPrefix(),
SSL_TRANSPORT_SERVER_EXTENDED_PREFIX
Expand All @@ -171,7 +171,7 @@ private Map<CertType, SslConfiguration> loadConfigurations(final Environment env
new SslConfiguration(transportSslParameters, transportClientTrustAndKeyStore.v1(), transportClientTrustAndKeyStore.v2())
);
} else {
validateTransportSettings(transpotSettings);
validateTransportSettings(transportSettings);
final var transportTrustAndKeyStore = new SslCertificatesLoader(CertType.TRANSPORT.sslConfigPrefix()).loadConfiguration(
environment
);
Expand Down

0 comments on commit 4176478

Please sign in to comment.