-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Streaming Indexing] Ensure support of the new transport by security …
…plugin Signed-off-by: Andriy Redko <[email protected]>
- Loading branch information
Showing
9 changed files
with
925 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
...ansport-reactor-netty4/src/main/java/org/opensearch/http/reactor/netty4/ssl/SslUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
package org.opensearch.http.reactor.netty4.ssl; | ||
|
||
import org.opensearch.OpenSearchSecurityException; | ||
|
||
import javax.net.ssl.SSLContext; | ||
import javax.net.ssl.SSLEngine; | ||
|
||
import java.security.NoSuchAlgorithmException; | ||
|
||
/** | ||
* Helper class for creating default SSL engines | ||
*/ | ||
public class SslUtils { | ||
private static final String[] DEFAULT_SSL_PROTOCOLS = { "TLSv1.3", "TLSv1.2", "TLSv1.1" }; | ||
Check warning on line 24 in plugins/transport-reactor-netty4/src/main/java/org/opensearch/http/reactor/netty4/ssl/SslUtils.java Codecov / codecov/patchplugins/transport-reactor-netty4/src/main/java/org/opensearch/http/reactor/netty4/ssl/SslUtils.java#L24
|
||
|
||
private SslUtils() {} | ||
|
||
/** | ||
* Creates default server {@link SSLEngine} instance | ||
* @return default server {@link SSLEngine} instance | ||
*/ | ||
public static SSLEngine createDefaultServerSSLEngine() { | ||
try { | ||
final SSLEngine engine = SSLContext.getDefault().createSSLEngine(); | ||
engine.setEnabledProtocols(DEFAULT_SSL_PROTOCOLS); | ||
engine.setUseClientMode(false); | ||
return engine; | ||
} catch (final NoSuchAlgorithmException ex) { | ||
throw new OpenSearchSecurityException("Unable to initialize default server SSL engine", ex); | ||
Check warning on line 39 in plugins/transport-reactor-netty4/src/main/java/org/opensearch/http/reactor/netty4/ssl/SslUtils.java Codecov / codecov/patchplugins/transport-reactor-netty4/src/main/java/org/opensearch/http/reactor/netty4/ssl/SslUtils.java#L34-L39
|
||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...ort-reactor-netty4/src/main/java/org/opensearch/http/reactor/netty4/ssl/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
/** | ||
* SSL supporting utility classes | ||
*/ | ||
package org.opensearch.http.reactor.netty4.ssl; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.