core/src/main/java/co/elastic/tealess/TealessSSLContextBuilder.java
/**
   * Build an {@link SSLContext}  based on the parameters set in this TealessSSLContextBuilder.
   *
   * @return {@link SSLContext}
   * @throws KeyManagementException
   * @throws KeyStoreException
   * @throws NoSuchAlgorithmException
   */
Build an  SSLContext  based on the parameters set in this TealessSSLContextBuilder.
Build an SSLContext based on the parameters set in this TealessSSLContextBuilder .
public SSLContext build() throws KeyManagementException, KeyStoreException, NoSuchAlgorithmException {
    SSLContext ctx = SSLContext.getInstance("TLS");
    KeyManager[] kms = null;
    if (keyManagerFactory != null) {
      kms = Arrays.stream(keyManagerFactory.getKeyManagers())
              .map((km) -> new LoggingKeyManager((X509KeyManager) km))
              .toArray(X509KeyManager[]::new);
    }
    TrustManager[] tms = buildTrustStore();
    logger.trace("Building SSLContext with keys:{}, trusts:{}", kms, tms);
    SSLContextSpi spi = new TealessSSLContextSpi(ctx, cipherSuites);
    SSLContext tealessContext = new TealessSSLContext(spi, null, null);
    tealessContext.init(kms, tms, random);
    return tealessContext;
  }
public SSLContext build ( ) throws KeyManagementException , KeyStoreException , NoSuchAlgorithmException { SSLContext ctx = SSLContext . getInstance ( "TLS" ) ; KeyManager [ ] kms = null ; if ( keyManagerFactory != null ) { kms = Arrays . stream ( keyManagerFactory . getKeyManagers ( ) ) . map ( ( km ) -> new LoggingKeyManager ( ( X509KeyManager ) km ) ) . toArray ( X509KeyManager [ ] :: new ) ; } TrustManager [ ] tms = buildTrustStore ( ) ; logger . trace ( "Building SSLContext with keys:{}, trusts:{}" , kms , tms ) ; SSLContextSpi spi = new TealessSSLContextSpi ( ctx , cipherSuites ) ; SSLContext tealessContext = new TealessSSLContext ( spi , null , null ) ; tealessContext . init ( kms , tms , random ) ; return tealessContext ; }
Build an {@link SSLContext}  based on the parameters set in this TealessSSLContextBuilder.
Build an { @link SSLContext } based on the parameters set in this TealessSSLContextBuilder .