javax.net.ssl.SSLContext.getProtocol()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(5.5k)|赞(0)|评价(0)|浏览(151)

本文整理了Java中javax.net.ssl.SSLContext.getProtocol()方法的一些代码示例,展示了SSLContext.getProtocol()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SSLContext.getProtocol()方法的具体详情如下:
包路径:javax.net.ssl.SSLContext
类名称:SSLContext
方法名:getProtocol

SSLContext.getProtocol介绍

[英]Returns the name of the secure socket protocol of this instance.
[中]返回此实例的安全套接字协议的名称。

代码示例

代码示例来源:origin: apache/zookeeper

private String[] getEnabledProtocols(final ZKConfig config, final SSLContext sslContext) {
  String enabledProtocolsInput = config.getProperty(x509Util.getSslEnabledProtocolsProperty());
  if (enabledProtocolsInput == null) {
    return new String[] { sslContext.getProtocol() };
  }
  return enabledProtocolsInput.split(",");
}

代码示例来源:origin: apache/ignite

/**
   * @param delegate Wrapped SSL context.
   * @param sslParameters Extended SSL parameters.
   */
  public SSLContextWrapper(SSLContext delegate, SSLParameters sslParameters) {
    super(new DelegatingSSLContextSpi(delegate, sslParameters),
      delegate.getProvider(),
      delegate.getProtocol());
  }
}

代码示例来源:origin: wildfly/wildfly

/**
   * Construct a new instance.
   *
   * @param contextSpi the SSL context SPI to delegate to
   */
  DelegatingSSLContext(final AbstractDelegatingSSLContextSpi contextSpi) {
    super(contextSpi, contextSpi.getDelegate().getProvider(), contextSpi.getDelegate().getProtocol());
  }
}

代码示例来源:origin: wildfly/wildfly

public SNISSLContext(SNIContextMatcher matcher) {
    super(new SNISSLContextSpi(matcher), matcher.getDefaultContext().getProvider(), matcher.getDefaultContext().getProtocol());
  }
}

代码示例来源:origin: wildfly/wildfly

public SNISSLContext(SNIContextMatcher matcher) {
    super(new SNISSLContextSpi(matcher), matcher.getDefaultContext().getProvider(), matcher.getDefaultContext().getProtocol());
  }
}

代码示例来源:origin: apache/zookeeper

@Test(timeout = 5000)
public void testCreateSSLContextWithoutCustomProtocol() throws Exception {
  SSLContext sslContext = x509Util.getDefaultSSLContext();
  Assert.assertEquals(X509Util.DEFAULT_PROTOCOL, sslContext.getProtocol());
}

代码示例来源:origin: apache/zookeeper

@Test(timeout = 5000)
public void testCreateSSLContextWithCustomProtocol() throws Exception {
  final String protocol = "TLSv1.1";
  System.setProperty(x509Util.getSslProtocolProperty(), protocol);
  SSLContext sslContext = x509Util.getDefaultSSLContext();
  Assert.assertEquals(protocol, sslContext.getProtocol());
}

代码示例来源:origin: camunda/camunda-bpm-platform

: SSLContext.getInstance(getProtocol());
context.addInfo("SSL protocol '" + sslContext.getProtocol() 
  + "' provider '" + sslContext.getProvider() + "'");

代码示例来源:origin: org.apache.cxf/cxf-rt-transports-http

.getSecureSocketProtocol() : ctx.getProtocol();
socketFactory = new SSLSocketFactoryWrapper(ctx.getSocketFactory(), cipherSuites,
                      protocol);

代码示例来源:origin: apache/cloudstack

@Test
public void getSSLContextTestStringAsParameter() throws NoSuchAlgorithmException, NoSuchProviderException {
  Assert.assertEquals("TLSv1.2", spySSLUtils.getSSLContext("SunJSSE").getProtocol());
}

代码示例来源:origin: apache/cloudstack

@Test
public void getSSLContextTest() throws NoSuchAlgorithmException {
  Assert.assertEquals("TLSv1.2", spySSLUtils.getSSLContext().getProtocol());
}

代码示例来源:origin: org.apache.ignite/ignite-core

/** */
  SSLContextWrapper(SSLContext delegate, SSLParameters sslParameters) {
    super(new DelegatingSSLContextSpi(delegate, sslParameters),
      delegate.getProvider(),
      delegate.getProtocol());
  }
}

代码示例来源:origin: org.restlet.jse/org.restlet.ext.ssl

/**
 * Constructor.
 * 
 * @param contextFactory
 *            The parent SSL context factory.
 * @param wrappedContext
 *            The wrapped SSL context.
 * 
 */
public DefaultSslContext(DefaultSslContextFactory contextFactory,
    SSLContext wrappedContext) {
  super(createContextSpi(contextFactory, wrappedContext), wrappedContext
      .getProvider(), wrappedContext.getProtocol());
}

代码示例来源:origin: org.wildfly.security/wildfly-elytron

/**
   * Construct a new instance.
   *
   * @param contextSpi the SSL context SPI to delegate to
   */
  DelegatingSSLContext(final AbstractDelegatingSSLContextSpi contextSpi) {
    super(contextSpi, contextSpi.getDelegate().getProvider(), contextSpi.getDelegate().getProtocol());
  }
}

代码示例来源:origin: org.wildfly.security/wildfly-elytron-ssl

/**
   * Construct a new instance.
   *
   * @param contextSpi the SSL context SPI to delegate to
   */
  DelegatingSSLContext(final AbstractDelegatingSSLContextSpi contextSpi) {
    super(contextSpi, contextSpi.getDelegate().getProvider(), contextSpi.getDelegate().getProtocol());
  }
}

代码示例来源:origin: org.jboss.eap/wildfly-client-all

/**
   * Construct a new instance.
   *
   * @param contextSpi the SSL context SPI to delegate to
   */
  DelegatingSSLContext(final AbstractDelegatingSSLContextSpi contextSpi) {
    super(contextSpi, contextSpi.getDelegate().getProvider(), contextSpi.getDelegate().getProtocol());
  }
}

代码示例来源:origin: io.undertow/undertow-core

public SNISSLContext(SNIContextMatcher matcher) {
    super(new SNISSLContextSpi(matcher), matcher.getDefaultContext().getProvider(), matcher.getDefaultContext().getProtocol());
  }
}

代码示例来源:origin: org.wildfly.security/wildfly-elytron-ssl

public SNISSLContext(SNIContextMatcher matcher) {
    super(new SNISSLContextSpi(matcher), matcher.getDefaultContext().getProvider(), matcher.getDefaultContext().getProtocol());
  }
}

代码示例来源:origin: org.wildfly.security/wildfly-elytron

public SNISSLContext(SNIContextMatcher matcher) {
    super(new SNISSLContextSpi(matcher), matcher.getDefaultContext().getProvider(), matcher.getDefaultContext().getProtocol());
  }
}

代码示例来源:origin: apache/httpcomponents-core

@Test
public void testBuildAllNull_deprecated() throws Exception {
  final SSLContext sslContext = SSLContextBuilder.create()
      .setProtocol(null)
      .setSecureRandom(null)
      .loadTrustMaterial((KeyStore) null, null)
      .loadKeyMaterial((KeyStore) null, null, null)
      .build();
  Assert.assertNotNull(sslContext);
  Assert.assertEquals("TLS", sslContext.getProtocol());
}

相关文章