2 * Copyright (c) 2024 PANTHEON.tech, s.r.o. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.netconf.transport.tls;
10 import static java.util.Objects.requireNonNull;
12 import io.netty.handler.ssl.SslContext;
13 import java.net.SocketAddress;
14 import org.opendaylight.netconf.transport.api.UnsupportedConfigurationException;
15 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.tls.client.rev231228.TlsClientGrouping;
16 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.tls.server.rev231228.TlsServerGrouping;
18 public final class FixedSslHandlerFactory extends SslHandlerFactory {
19 private final SslContext sslContext;
21 public FixedSslHandlerFactory(final SslContext sslContext) {
22 this.sslContext = requireNonNull(sslContext);
25 public FixedSslHandlerFactory(final TlsClientGrouping clientParams) throws UnsupportedConfigurationException {
26 this(createSslContext(clientParams));
29 public FixedSslHandlerFactory(final TlsServerGrouping serverParams) throws UnsupportedConfigurationException {
30 this(createSslContext(serverParams));
34 protected SslContext getSslContext(final SocketAddress remoteAddress) {