code: public SSLEngine get() {
      try {
        String pass = env.sslKeystorePassword();
        char[] password = pass == null || pass.isEmpty() ? null : pass.toCharArray();
  
        KeyStore ks = env.sslKeystore();
        if (ks == null) {
          ks = KeyStore.getInstance(KeyStore.getDefaultType());
          String ksFile = env.sslKeystoreFile();
          if (ksFile == null || ksFile.isEmpty()) {
            throw new IllegalArgumentException("Path to Keystore File must not be null or empty.");
          }
          ks.load(new FileInputStream(ksFile), password);
        }
        String defaultAlgorithm = KeyManagerFactory.getDefaultAlgorithm();
        KeyManagerFactory kmf = KeyManagerFactory.getInstance(defaultAlgorithm);
        TrustManagerFactory tmf = TrustManagerFactory.getInstance(defaultAlgorithm);
        kmf.init(ks, password);
        tmf.init(ks);
  
        SSLContext ctx = SSLContext.getInstance("TLS");
        ctx.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);
  
        SSLEngine engine = ctx.createSSLEngine();
        engine.setUseClientMode(true);
        return engine;
      } catch (Exception ex) {
        throw new SSLException("Could not create SSLEngine.", ex);
      }
    }
docs: Returns a new {@link SSLEngine} constructed from the config settings.
  
  @return a {@link SSLEngine} ready to be used.