Examples of SSLContextBuilder


Examples of com.squareup.okhttp.internal.SslContextBuilder

   protected SSLContext sslContext;

   @BeforeClass(groups = "integration")
   protected void setupSSL() {
      try {
         sslContext = new SslContextBuilder(InetAddress.getLocalHost().getHostName()).build();
      } catch (GeneralSecurityException ex) {
         throw new RuntimeException(ex);
      } catch (UnknownHostException ex) {
         throw new RuntimeException(ex);
      }
View Full Code Here

Examples of com.squareup.okhttp.internal.SslContextBuilder

   protected SSLContext sslContext;

   @BeforeClass(groups = "integration")
   protected void setupSSL() {
      try {
         sslContext = new SslContextBuilder(InetAddress.getLocalHost().getHostName()).build();
      } catch (GeneralSecurityException ex) {
         throw new RuntimeException(ex);
      } catch (UnknownHostException ex) {
         throw new RuntimeException(ex);
      }
View Full Code Here

Examples of com.trendrr.oss.SSLContextBuilder

    }
   
    DynMap ssl = config.get(DynMap.class, "ssl");
   
    if (ssl != null) {
      SSLContextBuilder builder = new SSLContextBuilder(false);
      builder.keystoreFilename(ssl.get(String.class, "keystore"));
      builder.keystorePassword(ssl.get(String.class, "keystore_password"));
      builder.certificatePassword(ssl.get(String.class, "certificate_password"));
      server.setSSLContext(builder.toSSLContext());
      server.setSslPort(ssl.get(Integer.class, "port", server.getSslPort()));
    }
    server.config = config;
    server.getRouter().setServer(server);
  }
View Full Code Here

Examples of org.apache.http.conn.ssl.SSLContextBuilder

        SSLConnectionSocketFactory sslConnectionSocketFactory;
        if ( SSL_INSECURE )
        {
            try
            {
                SSLContext sslContext = new SSLContextBuilder().useSSL().loadTrustMaterial( null,
                                                                                            new RelaxedTrustStrategy(
                                                                                                IGNORE_SSL_VALIDITY_DATES ) ).build();
                sslConnectionSocketFactory = new SSLConnectionSocketFactory( sslContext, sslProtocols, cipherSuites,
                                                                             SSL_ALLOW_ALL
                                                                                 ? SSLConnectionSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER
View Full Code Here

Examples of org.apache.http.conn.ssl.SSLContextBuilder

        return sslConfig;
    }

    private static void installAllTrustingClientSsl() throws KeyManagementException,
        NoSuchAlgorithmException, KeyStoreException {
        SSLContextBuilder builder = new SSLContextBuilder();
        builder.loadTrustMaterial(null, new TrustSelfSignedStrategy());
       
        // // Create a trust manager that does not validate certificate chains
        final TrustManager[] trustAllCerts = new TrustManager[] {new X509TrustManager() {
            @Override
            public void checkClientTrusted(final X509Certificate[] chain, final String authType) {
View Full Code Here

Examples of org.apache.http.conn.ssl.SSLContextBuilder

        SSLConnectionSocketFactory sslConnectionSocketFactory;
        if ( SSL_INSECURE )
        {
            try
            {
                SSLContext sslContext = new SSLContextBuilder().useSSL().loadTrustMaterial( null,
                                                                                            new RelaxedTrustStrategy(
                                                                                                IGNORE_SSL_VALIDITY_DATES ) ).build();
                sslConnectionSocketFactory = new SSLConnectionSocketFactory( sslContext, sslProtocols, cipherSuites,
                                                                             SSL_ALLOW_ALL
                                                                                 ? SSLConnectionSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER
View Full Code Here

Examples of org.apache.http.conn.ssl.SSLContextBuilder

                        sslReq.getKeyStore().getKeyStore();

                final TrustStrategy trustStrategy = sslReq.isTrustSelfSignedCert()
                        ? new TrustSelfSignedStrategy(): null;
               
                SSLContext ctx = new SSLContextBuilder()
                        .loadKeyMaterial(keyStore, sslReq.getKeyStore()!=null? sslReq.getKeyStore().getPassword(): null)
                        .loadTrustMaterial(trustStore, trustStrategy)
                        .setSecureRandom(null)
                        .useTLS()
                        .build();
View Full Code Here

Examples of org.apache.http.conn.ssl.SSLContextBuilder

        return builder.build();
  }

    private static SSLContext buildAllowAnythingSSLContext() {
        try {
            return new SSLContextBuilder().loadTrustMaterial(null, new TrustSelfSignedStrategy()).build();
        } catch (Exception e) {
            return throwUnchecked(e, SSLContext.class);
        }
    }
View Full Code Here

Examples of org.apache.http.conn.ssl.SSLContextBuilder

  protected RestTemplate restTemplate;

  @Before
  public void setUpRestTemplate() throws Exception {
    SSLConnectionSocketFactory socketFactory = new SSLConnectionSocketFactory(
        new SSLContextBuilder().loadTrustMaterial(null,
            new TrustSelfSignedStrategy()).build());

    HttpClient httpClient = HttpClients.custom().setSSLSocketFactory(socketFactory)
        .build();
View Full Code Here

Examples of org.apache.http.conn.ssl.SSLContextBuilder

    credentialsProvider.setCredentials(AuthScope.ANY, new UsernamePasswordCredentials("admin", "whosThere"));
    HttpComponentsClientHttpRequestFactory requestFactory =
        new HttpComponentsClientHttpRequestFactory(HttpClientBuilder.create()
            .setDefaultCredentialsProvider(credentialsProvider)
            .setSSLSocketFactory(new SSLConnectionSocketFactory(
                new SSLContextBuilder().loadTrustMaterial(null,
                    new TrustSelfSignedStrategy())
                    .build()))
            .build());
    SpringXDTemplate template = new SpringXDTemplate(requestFactory, new URI("https://localhost:" + adminPort));
    PagedResources<ModuleDefinitionResource> moduleDefinitions = template.moduleOperations().list(RESTModuleType.sink);
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.