Skip to content

Commit 3274f9d

Browse files
authored
Add the fallback logic to use 'ssl_engine' if 'ssl_handler' attribute is not available / compatible (#5667)
Signed-off-by: Andriy Redko <drreta@gmail.com>
1 parent 853c501 commit 3274f9d

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
2929
- Updates resource visibility when handling PATCH api to update sharing record ([#5654](https://github.com/opensearch-project/security/pull/5654))
3030
- Handles resource updates which otherwise may wipe out all_shared_principals ([#5658](https://github.com/opensearch-project/security/pull/5658))
3131
- Makes initial share map mutable to allow multiple shares ([#5666](https://github.com/opensearch-project/security/pull/5666))
32+
- Add the fallback logic to use 'ssl_engine' if 'ssl_handler' attribute is not available / compatible ([#5667](https://github.com/opensearch-project/security/pull/5667))
3233

3334
### Refactoring
3435

src/main/java/org/opensearch/security/filter/OpenSearchRequest.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import java.util.Set;
2020
import javax.net.ssl.SSLEngine;
2121

22+
import org.opensearch.http.HttpChannel;
2223
import org.opensearch.rest.RestRequest;
2324
import org.opensearch.rest.RestRequest.Method;
2425

@@ -46,7 +47,11 @@ public SSLEngine getSSLEngine() {
4647
return null;
4748
}
4849

49-
return underlyingRequest.getHttpChannel().get("ssl_http", SslHandler.class).map(SslHandler::engine).orElse(null);
50+
final HttpChannel httpChannel = underlyingRequest.getHttpChannel();
51+
return httpChannel.get("ssl_http", SslHandler.class)
52+
.map(SslHandler::engine)
53+
.or(() -> httpChannel.get("ssl_engine", SSLEngine.class))
54+
.orElse(null);
5055
}
5156

5257
@Override

0 commit comments

Comments
 (0)