1 /*
2 * Copyright 2024 The Netty Project
3 *
4 * The Netty Project licenses this file to you under the Apache License,
5 * version 2.0 (the "License"); you may not use this file except in compliance
6 * with the License. You may obtain a copy of the License at:
7 *
8 * https://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 * License for the specific language governing permissions and limitations
14 * under the License.
15 */
16 package io.netty.handler.codec.quic;
17
18 import io.netty.handler.ssl.SslContextOption;
19
20 import java.util.Map;
21 import java.util.Set;
22
23 /**
24 * {@link SslContextOption}s that are specific to BoringSSL.
25 *
26 * @param <T> the type of the value.
27 */
28 public final class BoringSSLContextOption<T> extends SslContextOption<T> {
29 private BoringSSLContextOption(String name) {
30 super(name);
31 }
32
33 /**
34 * Set the groups that should be used. This will override curves set with {@code -Djdk.tls.namedGroups}.
35 * <p>
36 * See <a href="https://github.com/google/boringssl/blob/master/include/openssl/ssl.h#L2632">
37 * SSL_CTX_set1_groups_list</a>.
38 */
39 public static final BoringSSLContextOption<String[]> GROUPS = new BoringSSLContextOption<>("GROUPS");
40
41 /**
42 * Set the signature algorithms that should be used.
43 * <p>
44 * See <a href="https://github.com/google/boringssl/blob/master/include/openssl/ssl.h#L5166">
45 * SSL_CTX_set1_sigalgs</a>.
46 */
47 public static final BoringSSLContextOption<String[]> SIGNATURE_ALGORITHMS =
48 new BoringSSLContextOption<>("SIGNATURE_ALGORITHMS");
49
50 /**
51 * Set the supported client key/certificate types used in BoringSSLCertificateCallback
52 */
53 public static final BoringSSLContextOption<Set<String>> CLIENT_KEY_TYPES =
54 new BoringSSLContextOption<>("CLIENT_KEY_TYPES");
55
56 /**
57 * Set the supported server key/certificate types used in BoringSSLCertificateCallback
58 */
59 public static final BoringSSLContextOption<Map<String, String>> SERVER_KEY_TYPES =
60 new BoringSSLContextOption<>("SERVER_KEY_TYPES");
61 }