GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Allow to set used named groups per OpenSslContext by normanmaurer · Pull Request #14433 · netty/netty

Allow to set used named groups per OpenSslContext #14433

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
normanmaurer merged 2 commits into 4.1 from ssl_groups
Nov 7, 2024

Uh oh!

There was an error while loading. Please reload this page.

Merged

Allow to set used named groups per OpenSslContext #14433

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
2 commits
Select commit Hold shift + click to select a range
9eec101
Allow to set used named groups per OpenSslContext
normanmaurer Nov 6, 2024
a82b86f
Update handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpe…
normanmaurer Nov 7, 2024
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view

There are no files selected for viewing

8 changes: 8 additions & 0 deletions 8 handler/src/main/java/io/netty/handler/ssl/OpenSslContextOption.java
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,12 @@ private OpenSslContextOption(String name) {
*/
public static final OpenSslContextOption<Integer> MAX_CERTIFICATE_LIST_BYTES =
new OpenSslContextOption<Integer>("MAX_CERTIFICATE_LIST_BYTES");

/**
* Set the groups that should be used. This will override curves set with {@code -Djdk.tls.namedGroups}.
* <p>
* See <a href="https://docs.openssl.org/master/man3/SSL_CTX_set1_groups_list/#description">
* SSL_CTX_set1_groups_list</a>.
*/
public static final OpenSslContextOption<String[]> GROUPS = new OpenSslContextOption<String[]>("GROUPS");
}
15 changes: 12 additions & 3 deletions 15 handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslContext.java
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,11 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.Executor;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReadWriteLock;
Expand Down Expand Up @@ -234,7 +236,7 @@ public ApplicationProtocolConfig.SelectedListenerFailureBehavior selectedListene
OpenSslAsyncPrivateKeyMethod asyncPrivateKeyMethod = null;
OpenSslCertificateCompressionConfig certCompressionConfig = null;
Integer maxCertificateList = null;

String[] groups = OpenSsl.NAMED_GROUPS;
if (ctxOptions != null) {
for (Map.Entry<SslContextOption<?>, Object> ctxOpt : ctxOptions) {
SslContextOption<?> option = ctxOpt.getKey();
Expand All @@ -251,6 +253,13 @@ public ApplicationProtocolConfig.SelectedListenerFailureBehavior selectedListene
certCompressionConfig = (OpenSslCertificateCompressionConfig) ctxOpt.getValue();
} else if (option == OpenSslContextOption.MAX_CERTIFICATE_LIST_BYTES) {
maxCertificateList = (Integer) ctxOpt.getValue();
} else if (option == OpenSslContextOption.GROUPS) {
String[] groupsArray = (String[]) ctxOpt.getValue();
Set<String> groupsSet = new LinkedHashSet<String>(groupsArray.length);
for (String group : groupsArray) {
groupsSet.add(GroupsConverter.toOpenSsl(group));
}
groups = groupsSet.toArray(EmptyArrays.EMPTY_STRINGS);
} else {
logger.debug("Skipping unsupported " + SslContextOption.class.getSimpleName()
+ ": " + ctxOpt.getKey());
Expand Down Expand Up @@ -436,8 +445,8 @@ public ApplicationProtocolConfig.SelectedListenerFailureBehavior selectedListene
}

// Set the curves / groups if anything is configured.
if (OpenSsl.NAMED_GROUPS.length > 0 && !SSLContext.setCurvesList(ctx, OpenSsl.NAMED_GROUPS)) {
String msg = "failed to set curves / groups suite: " + Arrays.toString(OpenSsl.NAMED_GROUPS);
if (groups.length > 0 && !SSLContext.setCurvesList(ctx, groups)) {
String msg = "failed to set curves / groups suite: " + Arrays.toString(groups);
int err = SSL.getLastErrorNumber();
if (err != 0) {
// We have some more details about why the operations failed, include these into the message.
Expand Down
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.