本文整理了Java中javax.net.ssl.SSLEngine.getSupportedCipherSuites()
方法的一些代码示例,展示了SSLEngine.getSupportedCipherSuites()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SSLEngine.getSupportedCipherSuites()
方法的具体详情如下:
包路径:javax.net.ssl.SSLEngine
类名称:SSLEngine
方法名:getSupportedCipherSuites
[英]Returns the SSL cipher suite names that are supported by this engine. These cipher suites can be enabled using #setEnabledCipherSuites(String[]).
[中]返回此引擎支持的SSL密码套件名称。可以使用#setEnabledCipherSuite(字符串[])启用这些密码套件。
代码示例来源:origin: redisson/redisson
@Override
public String[] getSupportedCipherSuites() {
return engine.getSupportedCipherSuites();
}
代码示例来源:origin: wildfly/wildfly
@Override
public String[] getSupportedCipherSuites() {
return engine.getSupportedCipherSuites();
}
代码示例来源:origin: wildfly/wildfly
@Override
public String[] getSupportedCipherSuites() {
return delegate.getSupportedCipherSuites();
}
代码示例来源:origin: wildfly/wildfly
@Override
public String[] getSupportedCipherSuites() {
return delegate.getSupportedCipherSuites();
}
代码示例来源:origin: wildfly/wildfly
public String[] getSupportedCipherSuites() {
return delegate.getSupportedCipherSuites();
}
代码示例来源:origin: io.netty/netty
@Override
public String[] getSupportedCipherSuites() {
return engine.getSupportedCipherSuites();
}
代码示例来源:origin: wildfly/wildfly
public String[] getSupportedCipherSuites() {
return currentRef.get().getSupportedCipherSuites();
}
代码示例来源:origin: wildfly/wildfly
public String[] getSupportedCipherSuites() {
return currentRef.get().getSupportedCipherSuites();
}
代码示例来源:origin: wildfly/wildfly
public String[] getSupportedCipherSuites() {
return currentRef.get().getSupportedCipherSuites();
}
代码示例来源:origin: igniterealtime/Openfire
/**
* Returns the names of all encryption cipher suites that are supported (but not necessarily enabled).
*
* @return An array of cipher suite names. Not expected to be empty.
*/
public static List<String> getSupportedCipherSuites() throws NoSuchAlgorithmException, KeyManagementException
{
// TODO Might want to cache the result. It's unlikely to change at runtime.
final SSLContext context = SSLContext.getInstance( "TLSv1" );
context.init( null, null, null );
return Arrays.asList( context.createSSLEngine().getSupportedCipherSuites() );
}
代码示例来源:origin: redisson/redisson
private static Set<String> supportedCiphers(SSLEngine engine) {
// Choose the sensible default list of cipher suites.
final String[] supportedCiphers = engine.getSupportedCipherSuites();
Set<String> supportedCiphersSet = new LinkedHashSet<String>(supportedCiphers.length);
for (int i = 0; i < supportedCiphers.length; ++i) {
String supportedCipher = supportedCiphers[i];
supportedCiphersSet.add(supportedCipher);
// IBM's J9 JVM utilizes a custom naming scheme for ciphers and only returns ciphers with the "SSL_"
// prefix instead of the "TLS_" prefix (as defined in the JSSE cipher suite names [1]). According to IBM's
// documentation [2] the "SSL_" prefix is "interchangeable" with the "TLS_" prefix.
// See the IBM forum discussion [3] and issue on IBM's JVM [4] for more details.
//[1] http://docs.oracle.com/javase/8/docs/technotes/guides/security/StandardNames.html#ciphersuites
//[2] https://www.ibm.com/support/knowledgecenter/en/SSYKE2_8.0.0/com.ibm.java.security.component.80.doc/
// security-component/jsse2Docs/ciphersuites.html
//[3] https://www.ibm.com/developerworks/community/forums/html/topic?id=9b5a56a9-fa46-4031-b33b-df91e28d77c2
//[4] https://www.ibm.com/developerworks/rfe/execute?use_case=viewRfe&CR_ID=71770
if (supportedCipher.startsWith("SSL_")) {
final String tlsPrefixedCipherName = "TLS_" + supportedCipher.substring("SSL_".length());
try {
engine.setEnabledCipherSuites(new String[]{tlsPrefixedCipherName});
supportedCiphersSet.add(tlsPrefixedCipherName);
} catch (IllegalArgumentException ignored) {
// The cipher is not supported ... move on to the next cipher.
}
}
}
return supportedCiphersSet;
}
代码示例来源:origin: wildfly/wildfly
final Sequence<String> cipherSuites = optionMap.get(Options.SSL_ENABLED_CIPHER_SUITES);
if (cipherSuites != null) {
final Set<String> supported = new HashSet<String>(Arrays.asList(engine.getSupportedCipherSuites()));
final List<String> finalList = new ArrayList<String>();
for (String name : cipherSuites) {
代码示例来源:origin: wildfly/wildfly
public void configure(final SSLContext context, final SSLEngine sslEngine) {
sslEngine.setUseClientMode(clientMode);
final SSLParameters sslParameters = sslEngine.getSSLParameters();
configure(sslParameters, sslEngine.getSupportedProtocols(), sslEngine.getSupportedCipherSuites());
sslEngine.setSSLParameters(sslParameters);
}
代码示例来源:origin: wildfly/wildfly
final Sequence<String> cipherSuites = optionMap.get(Options.SSL_ENABLED_CIPHER_SUITES);
if (cipherSuites != null) {
final Set<String> supported = new HashSet<String>(Arrays.asList(engine.getSupportedCipherSuites()));
final List<String> finalList = new ArrayList<String>();
for (String name : cipherSuites) {
代码示例来源:origin: dropwizard/dropwizard
private void logSupportedParameters(SslContextFactory contextFactory) {
if (LOGGED.compareAndSet(false, true)) {
// When Jetty logs out which protocols are enabled / disabled they include tracing
// information to detect if the protocol was disabled at the
// JRE/lib/security/java.security level. Since we don't log this information we take the
// SSLEngine from our context instead of a pristine version.
//
// For more info from Jetty:
// https://github.com/eclipse/jetty.project/blob/93a8afcc6bd1a6e0af7bd9f967c97ae1bc3eb718/jetty-util/src/main/java/org/eclipse/jetty/util/ssl/SslContextFactory.java#L356-L360
final SSLEngine engine = contextFactory.getSslContext().createSSLEngine();
final Map<Boolean, List<String>> protocols = partitionSupport(
engine.getSupportedProtocols(),
engine.getEnabledProtocols(),
contextFactory.getExcludeProtocols(),
contextFactory.getIncludeProtocols()
);
final Map<Boolean, List<String>> ciphers = partitionSupport(
engine.getSupportedCipherSuites(),
engine.getEnabledCipherSuites(),
contextFactory.getExcludeCipherSuites(),
contextFactory.getIncludeCipherSuites()
);
LOGGER.info("Enabled protocols: {}", protocols.get(true));
LOGGER.info("Disabled protocols: {}", protocols.get(false));
LOGGER.info("Enabled cipher suites: {}", ciphers.get(true));
LOGGER.info("Disabled cipher suites: {}", ciphers.get(false));
}
}
代码示例来源:origin: wildfly/wildfly
final String[] cipherSuites = AbstractAcceptingSslChannel.this.cipherSuites;
if (cipherSuites != null) {
final Set<String> supported = new HashSet<String>(Arrays.asList(engine.getSupportedCipherSuites()));
final List<String> finalList = new ArrayList<String>();
for (String name : cipherSuites) {
代码示例来源:origin: wildfly/wildfly
public void setSSLParameters(final SSLContext sslContext, final SSLEngine sslEngine, final SSLParameters parameters) {
sslEngine.setSSLParameters(redefine(parameters, sslEngine.getSupportedCipherSuites(), sslEngine.getSupportedProtocols()));
}
代码示例来源:origin: Netflix/zuul
LOG.debug("ssl protocols enabled: {}", String.join(", ", sslHandler.engine().getEnabledProtocols()));
LOG.debug("ssl ciphers supported: {}", String.join(", ", sslHandler.engine().getSupportedCipherSuites()));
LOG.debug("ssl ciphers enabled: {}", String.join(", ", sslHandler.engine().getEnabledCipherSuites()));
代码示例来源:origin: apache/incubator-druid
@Override
public void start() throws Exception
{
log.info("Starting Jetty Server...");
server.start();
if (node.isEnableTlsPort()) {
// Perform validation
Preconditions.checkNotNull(sslContextFactory);
final SSLEngine sslEngine = sslContextFactory.newSSLEngine();
if (sslEngine.getEnabledCipherSuites() == null || sslEngine.getEnabledCipherSuites().length == 0) {
throw new ISE(
"No supported cipher suites found, supported suites [%s], configured suites include list: [%s] exclude list: [%s]",
Arrays.toString(sslEngine.getSupportedCipherSuites()),
tlsServerConfig.getIncludeCipherSuites(),
tlsServerConfig.getExcludeCipherSuites()
);
}
if (sslEngine.getEnabledProtocols() == null || sslEngine.getEnabledProtocols().length == 0) {
throw new ISE(
"No supported protocols found, supported protocols [%s], configured protocols include list: [%s] exclude list: [%s]",
Arrays.toString(sslEngine.getSupportedProtocols()),
tlsServerConfig.getIncludeProtocols(),
tlsServerConfig.getExcludeProtocols()
);
}
}
}
代码示例来源:origin: Netflix/zuul
LOG.debug("ssl protocols enabled: {}", String.join(", ", sslHandler.engine().getEnabledProtocols()));
LOG.debug("ssl ciphers supported: {}", String.join(", ", sslHandler.engine().getSupportedCipherSuites()));
LOG.debug("ssl ciphers enabled: {}", String.join(", ", sslHandler.engine().getEnabledCipherSuites()));
内容来源于网络,如有侵权,请联系作者删除!