code:     private SSLEngine createSSLEngine(Map<String,Object> userProperties)
              throws DeploymentException {
  
          try {
              // See if a custom SSLContext has been provided
              SSLContext sslContext =
                      (SSLContext) userProperties.get(Constants.SSL_CONTEXT_PROPERTY);
  
              if (sslContext == null) {
                  // Create the SSL Context
                  sslContext = SSLContext.getInstance("TLS");
  
                  // Trust store
                  String sslTrustStoreValue =
                          (String) userProperties.get(Constants.SSL_TRUSTSTORE_PROPERTY);
                  if (sslTrustStoreValue != null) {
                      String sslTrustStorePwdValue = (String) userProperties.get(
                              Constants.SSL_TRUSTSTORE_PWD_PROPERTY);
                      if (sslTrustStorePwdValue == null) {
                          sslTrustStorePwdValue = Constants.SSL_TRUSTSTORE_PWD_DEFAULT;
                      }
  
                      File keyStoreFile = new File(sslTrustStoreValue);
                      KeyStore ks = KeyStore.getInstance("JKS");
                      try (InputStream is = new FileInputStream(keyStoreFile)) {
                          ks.load(is, sslTrustStorePwdValue.toCharArray());
                      }
  
                      TrustManagerFactory tmf = TrustManagerFactory.getInstance(
                              TrustManagerFactory.getDefaultAlgorithm());
                      tmf.init(ks);
  
                      sslContext.init(null, tmf.getTrustManagers(), null);
                  } else {
                      sslContext.init(null, null, null);
                  }
              }
  
              SSLEngine engine = sslContext.createSSLEngine();
  
              String sslProtocolsValue =
                      (String) userProperties.get(Constants.SSL_PROTOCOLS_PROPERTY);
              if (sslProtocolsValue != null) {
                  engine.setEnabledProtocols(sslProtocolsValue.split(","));
              }
  
              engine.setUseClientMode(true);
  
              return engine;
          } catch (Exception e) {
              throw new DeploymentException(sm.getString(
                      "wsWebSocketContainer.sslEngineFail"), e);
          }
      }
  
  
      @Override
  