Пример #1
0
 protected Client createInsecureClient(MessageHandler.Whole<String> messageHandler)
     throws KeyManagementException, NoSuchAlgorithmException {
   return new Client(
       createInsecureSocketContainer(),
       SslUtils.createInsecureHttpClient("root", "foobar"),
       "wss://localhost:9090/cockpit",
       messageHandler);
 }
Пример #2
0
 protected WebSocketContainer createInsecureSocketContainer()
     throws NoSuchAlgorithmException, KeyManagementException {
   ClientManager client = ClientManager.createClient();
   SslEngineConfigurator sslEngineConfigurator =
       new SslEngineConfigurator(SslUtils.createInsecureSslContext());
   sslEngineConfigurator.setHostnameVerifier(new SslUtils.AnyHostNameVerifier());
   client.getProperties().put(ClientProperties.SSL_ENGINE_CONFIGURATOR, sslEngineConfigurator);
   client.getProperties().put(ClientProperties.LOG_HTTP_UPGRADE, true);
   return client;
 }