code: public static SslContext forKeystore(InputStream keystore, String keystorePassword, String keyManagerAlgorithm)
              throws SecurityContextException {
  
          try {
              final KeyStore ks = KeyStore.getInstance(KEYSTORE_JKS);
              final KeyManagerFactory kmf = KeyManagerFactory.getInstance(keyManagerAlgorithm);
  
              ks.load(keystore, keystorePassword.toCharArray());
              kmf.init(ks, keystorePassword.toCharArray());
  
              SslContextBuilder ctxBuilder = SslContextBuilder.forClient().keyManager(kmf);
              return ctxBuilder.build();
          } catch (Exception e) {
              throw new SecurityContextException(e);
          }
      }
docs: Builds SslContext using protected keystore file overriding default key manger algorithm. Adequate for non-mutual TLS connections.
  
  @param keystore Keystore inputstream (file, binaries, etc)
  @param keystorePassword Password for protected keystore file
  @param keyManagerAlgorithm Algorithm for keyManager used to process keystorefile
  @return SslContext ready to use
  @throws SecurityContextException for any troubles building the SslContext