You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pekko.apache.org by fa...@apache.org on 2024/01/21 21:18:33 UTC

(incubator-pekko-management) 01/01: Revert "Revert "performance change to loadCertificates""

This is an automated email from the ASF dual-hosted git repository.

fanningpj pushed a commit to branch revert-153-revert-152-pem-reader
in repository https://gitbox.apache.org/repos/asf/incubator-pekko-management.git

commit 2c87de1658959a94ab290790c7ddeb1492965876
Author: PJ Fanning <pj...@users.noreply.github.com>
AuthorDate: Sun Jan 21 22:18:27 2024 +0100

    Revert "Revert "performance change to loadCertificates""
---
 .../scala/org/apache/pekko/pki/kubernetes/PemManagersProvider.scala  | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/management-pki/src/main/scala/org/apache/pekko/pki/kubernetes/PemManagersProvider.scala b/management-pki/src/main/scala/org/apache/pekko/pki/kubernetes/PemManagersProvider.scala
index d9377b01..56a835da 100644
--- a/management-pki/src/main/scala/org/apache/pekko/pki/kubernetes/PemManagersProvider.scala
+++ b/management-pki/src/main/scala/org/apache/pekko/pki/kubernetes/PemManagersProvider.scala
@@ -13,7 +13,7 @@
 
 package org.apache.pekko.pki.kubernetes
 
-import java.io.{ ByteArrayInputStream, File }
+import java.io.File
 import java.nio.charset.StandardCharsets
 import java.nio.file.Files
 import java.security.{ KeyStore, PrivateKey }
@@ -67,8 +67,7 @@ private[pekko] object PemManagersProvider {
    * INTERNAL API
    */
   @InternalApi def loadCertificates(filename: String): Iterable[Certificate] = blocking {
-    val bytes = Files.readAllBytes(new File(filename).toPath)
-    certFactory.generateCertificates(new ByteArrayInputStream(bytes)).asScala
+    certFactory.generateCertificates(Files.newInputStream(new File(filename).toPath)).asScala
   }
 
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pekko.apache.org
For additional commands, e-mail: commits-help@pekko.apache.org