docs: private static SSLEngine createSSLEngine(SSLContext sslContext, OptionMap optionMap, InetSocketAddress peerAddress, boolean client) {
          final SSLEngine engine = sslContext.createSSLEngine(
                  optionMap.get(Options.SSL_PEER_HOST_NAME, peerAddress.getHostString()),
                  optionMap.get(Options.SSL_PEER_PORT, peerAddress.getPort())
          );
          engine.setUseClientMode(client);
          engine.setEnableSessionCreation(optionMap.get(Options.SSL_ENABLE_SESSION_CREATION, true));
          final Sequence<String> cipherSuites = optionMap.get(Options.SSL_ENABLED_CIPHER_SUITES);
          if (cipherSuites != null) {
              final Set<String> supported = new HashSet<String>(Arrays.asList(engine.getSupportedCipherSuites()));
              final List<String> finalList = new ArrayList<String>();
              for (String name : cipherSuites) {
                  if (supported.contains(name)) {
                      finalList.add(name);
                  }
              }
              engine.setEnabledCipherSuites(finalList.toArray(new String[finalList.size()]));
          }
          final Sequence<String> protocols = optionMap.get(Options.SSL_ENABLED_PROTOCOLS);
          if (protocols != null) {
              final Set<String> supported = new HashSet<String>(Arrays.asList(engine.getSupportedProtocols()));
              final List<String> finalList = new ArrayList<String>();
              for (String name : protocols) {
                  if (supported.contains(name)) {
                      finalList.add(name);
                  }
              }
              engine.setEnabledProtocols(finalList.toArray(new String[finalList.size()]));
          }
          return engine;
      }