Here you can find the source of setEnabledSSLProtocols(final Collection
Parameter | Description |
---|---|
enabledSSLProtocols | The set of SSL protocols that will be enabled for use for SSL sockets created within the LDAP SDK. It may be null or empty to indicate that the JDK-default set of enabled protocols should be used for the socket. |
public static void setEnabledSSLProtocols(final Collection<String> enabledSSLProtocols)
//package com.java2s; /*/*from w w w . j a va 2 s . c o m*/ * Copyright (C) 2008-2018 Ping Identity Corporation * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License (GPLv2 only) * or the terms of the GNU Lesser General Public License (LGPLv2.1 only) * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see <http://www.gnu.org/licenses>. */ import java.util.Collection; import java.util.Collections; import java.util.HashSet; import java.util.Set; import java.util.concurrent.atomic.AtomicReference; public class Main { /** * The default set of SSL protocols that will be enabled for use if available * for SSL sockets created within the LDAP SDK. */ private static final AtomicReference<Set<String>> ENABLED_SSL_PROTOCOLS = new AtomicReference<>(); /** * Specifies the set of SSL protocols that will be enabled for use for SSL * sockets created within the LDAP SDK. When creating an SSL socket, the * {@code SSLSocket.getSupportedProtocols} method will be used to determine * which protocols are supported for that socket, and then the * {@code SSLSocket.setEnabledProtocols} method will be used to enable those * protocols which are listed as both supported by the socket and included in * this set. If the provided set is {@code null} or empty, then the default * set of enabled protocols will be used. * * @param enabledSSLProtocols The set of SSL protocols that will be enabled * for use for SSL sockets created within the * LDAP SDK. It may be {@code null} or empty to * indicate that the JDK-default set of enabled * protocols should be used for the socket. */ public static void setEnabledSSLProtocols(final Collection<String> enabledSSLProtocols) { if (enabledSSLProtocols == null) { ENABLED_SSL_PROTOCOLS.set(Collections.<String>emptySet()); } else { ENABLED_SSL_PROTOCOLS.set(Collections.unmodifiableSet(new HashSet<>(enabledSSLProtocols))); } } }