Skip to content

Commit

Permalink
Improve error message when a node with an incorrectly configured cert…
Browse files Browse the repository at this point in the history
…ificate attempts to connect

Updated the error message to understand what is the exact reason and renamed the API name to match the intention of API.

Resolves opensearch-project#4601

Signed-off-by: Abdul Muneer Kolarkunnu <muneer.kolarkunnu@netapp.com>
  • Loading branch information
akolarkunnu committed Oct 17, 2024
1 parent 7692d77 commit 5d9375c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public static OpenSearchException createJwkCreationException(Throwable cause) {
return new OpenSearchException("An error occurred during the creation of Jwk: {}", cause, cause.getMessage());
}

public static OpenSearchException createTransportClientNoLongerSupportedException() {
return new OpenSearchException("Transport client authentication no longer supported.");
public static OpenSearchException clusterWrongNodeCertConfigException() {
return new OpenSearchException("Node certificate configuration is wrong or certificate is invalid.");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ protected void messageReceivedDecorate(
|| HeaderHelper.isTrustedClusterRequest(getThreadContext())
|| HeaderHelper.isExtensionRequest(getThreadContext()))) {
// CS-ENFORCE-SINGLE
final OpenSearchException exception = ExceptionUtils.createTransportClientNoLongerSupportedException();
final OpenSearchException exception = ExceptionUtils.clusterWrongNodeCertConfigException();
log.error(exception.toString());
transportChannel.sendResponse(exception);
return;
Expand Down

0 comments on commit 5d9375c

Please sign in to comment.