Examples of SSLParameters


Examples of javax.net.ssl.SSLParameters

    catch (NoSuchAlgorithmException e)
    {
      throw new RuntimeException(e);
    }

    _sslParameters = new SSLParameters();

    if (useSSL)
    {
      _clientFactories.put("https", new SimpleLoadBalancerTest.DoNothingClientFactory());
      _state =
View Full Code Here

Examples of javax.net.ssl.SSLParameters

  @Override
  public TransportClient getClient(Map<String, ? extends Object> properties)
  {
    SSLContext sslContext;
    SSLParameters sslParameters;

    // Copy the properties map since we don't want to mutate the passed-in map by removing keys
    properties = new HashMap<String,Object>(properties);
    sslContext = coerceAndRemoveFromMap(HTTP_SSL_CONTEXT, properties, SSLContext.class);
    sslParameters = coerceAndRemoveFromMap(HTTP_SSL_PARAMS, properties, SSLParameters.class);
View Full Code Here

Examples of javax.net.ssl.SSLParameters

  @Test
  public void testNewSSLProperties() throws Exception
  {
    HttpClientFactory factory = new HttpClientFactory();
    Map<String,Object> params = new HashMap<String, Object>();
    SSLParameters sslParameters = new SSLParameters();
    sslParameters.setProtocols(new String[]{ "Unsupported" });
    params.put(HttpClientFactory.HTTP_SSL_CONTEXT, SSLContext.getDefault());
    params.put(HttpClientFactory.HTTP_SSL_PARAMS, sslParameters);

    try
    {
View Full Code Here

Examples of javax.net.ssl.SSLParameters

  @Test
  public void testSSLParams() throws Exception
  {
    HttpClientFactory factory = new HttpClientFactory();
    Map<String,Object> params = new HashMap<String, Object>();
    SSLParameters sslParameters = new SSLParameters();
    sslParameters.setProtocols(new String[]{ "Unsupported" });

    params.put(HttpClientFactory.HTTP_SSL_CONTEXT, SSLContext.getDefault());
    params.put(HttpClientFactory.HTTP_SSL_PARAMS, sslParameters);

    try
View Full Code Here

Examples of javax.net.ssl.SSLParameters

  @Test
  public void testClientPipelineFactory1() throws NoSuchAlgorithmException
  {
    try
    {
      new HttpNettyClient(_factory, _scheduler, 1, 1, 1, 1, 1, null, new SSLParameters(), Integer.MAX_VALUE, _scheduler, Integer.MAX_VALUE);
    }
    catch (IllegalArgumentException e)
    {
      // Check exception message to make sure it's the expected one.
      Assert.assertEquals(e.getMessage(),
View Full Code Here

Examples of javax.net.ssl.SSLParameters

  // constructor.
  @Test
  public void testClientPipelineFactory2Fail() throws NoSuchAlgorithmException
  {
    String[] requestedCipherSuites = { "Unsupported" };
    SSLParameters sslParameters = new SSLParameters();
    sslParameters.setCipherSuites(requestedCipherSuites);
    try
    {
      new HttpNettyClient(_factory,
                          _scheduler,
                          1,
View Full Code Here

Examples of javax.net.ssl.SSLParameters

  // constructor.
  @Test
  public void testClientPipelineFactory2Pass() throws NoSuchAlgorithmException
  {
    String[] requestedCipherSuites = { "Unsupported", "SSL_RSA_WITH_RC4_128_SHA" };
    SSLParameters sslParameters = new SSLParameters();
    sslParameters.setCipherSuites(requestedCipherSuites);
    new HttpNettyClient(_factory,
                        _scheduler,
                        1,
                        1,
                        1,
View Full Code Here

Examples of javax.net.ssl.SSLParameters

  // constructor.
  @Test
  public void testClientPipelineFactory3Fail() throws NoSuchAlgorithmException
  {
    String[] requestedProtocols = { "Unsupported" };
    SSLParameters sslParameters = new SSLParameters();
    sslParameters.setProtocols(requestedProtocols);
    try
    {
      new HttpNettyClient(_factory,
                          _scheduler,
                          1,
View Full Code Here

Examples of javax.net.ssl.SSLParameters

  // constructor.
  @Test
  public void testClientPipelineFactory3Pass() throws NoSuchAlgorithmException
  {
    String[] requestedProtocols = { "Unsupported", "TLSv1" };
    SSLParameters sslParameters = new SSLParameters();
    sslParameters.setProtocols(requestedProtocols);
    new HttpNettyClient(_factory,
                        _scheduler,
                        1,
                        1,
                        1,
View Full Code Here

Examples of javax.net.ssl.SSLParameters

        if (sslContext == null)
        {
          throw new IllegalArgumentException("SSLParameters passed with no SSLContext");
        }

        SSLParameters supportedSSLParameters = sslContext.getSupportedSSLParameters();

        if (sslParameters.getCipherSuites() != null)
        {
          checkContained(supportedSSLParameters.getCipherSuites(),
                         sslParameters.getCipherSuites(),
                         "cipher suite");
        }

        if (sslParameters.getProtocols() != null)
        {
          checkContained(supportedSSLParameters.getProtocols(),
                         sslParameters.getProtocols(),
                         "protocol");
        }
      }
      _sslContext = sslContext;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.