Home / Function/ setSSLParameters() — netty Function Reference

setSSLParameters() — netty Function Reference

Architecture documentation for the setSSLParameters() function in ReferenceCountedOpenSslEngine.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  7c33dc7a_86d2_5105_a657_8dffc5ce9c64["setSSLParameters()"]
  df1ad81e_e5bf_85e6_4418_db301b4c3e66["ReferenceCountedOpenSslEngine"]
  7c33dc7a_86d2_5105_a657_8dffc5ce9c64 -->|defined in| df1ad81e_e5bf_85e6_4418_db301b4c3e66
  c2be282d_110e_3809_ba91_f76a8d2a4b03["isEmpty()"]
  7c33dc7a_86d2_5105_a657_8dffc5ce9c64 -->|calls| c2be282d_110e_3809_ba91_f76a8d2a4b03
  1fae7e09_5de0_48d7_717f_bb865b6a3921["configureEndpointVerification()"]
  7c33dc7a_86d2_5105_a657_8dffc5ce9c64 -->|calls| 1fae7e09_5de0_48d7_717f_bb865b6a3921
  style 7c33dc7a_86d2_5105_a657_8dffc5ce9c64 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslEngine.java lines 2210–2268

    @Override
    public final synchronized void setSSLParameters(SSLParameters sslParameters) {
        if (sslParameters.getAlgorithmConstraints() != null) {
            throw new IllegalArgumentException("AlgorithmConstraints are not supported.");
        }

        boolean isDestroyed = destroyed;
        if (!isDestroyed) {
            if (clientMode) {
                List<SNIServerName> proposedServerNames = sslParameters.getServerNames();
                if (proposedServerNames != null && !proposedServerNames.isEmpty()) {
                    for (SNIServerName serverName : proposedServerNames) {
                        if (!(serverName instanceof SNIHostName)) {
                            throw new IllegalArgumentException("Only " + SNIHostName.class.getName()
                                    + " instances are supported, but found: " + serverName);
                        }
                    }
                    for (SNIServerName serverName : proposedServerNames) {
                        SNIHostName name = (SNIHostName) serverName;
                        SSL.setTlsExtHostName(ssl, name.getAsciiName());
                    }
                }
                serverNames = proposedServerNames;
            }

            String[] groups = OpenSslParametersUtil.getNamesGroups(sslParameters);
            if (groups != null) {
                Set<String> groupsSet = new LinkedHashSet<String>(groups.length);
                for (String group : groups) {
                    if (group == null || group.isEmpty()) {
                        // See SSLParameters.html#setNamedGroups(java.lang.String[])
                        throw new IllegalArgumentException();
                    }
                    if (!groupsSet.add(GroupsConverter.toOpenSsl(group))) {
                        // See SSLParameters.html#setNamedGroups(java.lang.String[])
                        throw new IllegalArgumentException("named groups contains a duplicate");
                    }
                }
                if (!SSL.setCurvesList(ssl, groupsSet.toArray(EMPTY_STRINGS))) {
                    throw new UnsupportedOperationException();
                }
                this.groups = groups;
            }
            if (sslParameters.getUseCipherSuitesOrder()) {
                SSL.setOptions(ssl, SSL.SSL_OP_CIPHER_SERVER_PREFERENCE);
            } else {
                SSL.clearOptions(ssl, SSL.SSL_OP_CIPHER_SERVER_PREFERENCE);
            }
        }
        matchers = sslParameters.getSNIMatchers();

        final String endpointIdentificationAlgorithm = sslParameters.getEndpointIdentificationAlgorithm();
        if (!isDestroyed) {
            configureEndpointVerification(endpointIdentificationAlgorithm);
        }
        this.endpointIdentificationAlgorithm = endpointIdentificationAlgorithm;
        algorithmConstraints = sslParameters.getAlgorithmConstraints();
        super.setSSLParameters(sslParameters);
    }

Domain

Subdomains

Frequently Asked Questions

What does setSSLParameters() do?
setSSLParameters() is a function in the netty codebase, defined in handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslEngine.java.
Where is setSSLParameters() defined?
setSSLParameters() is defined in handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslEngine.java at line 2210.
What does setSSLParameters() call?
setSSLParameters() calls 2 function(s): configureEndpointVerification, isEmpty.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free