Skip to content

Commit

Permalink
Revert "performance change to loadCertificates" (#153)
Browse files Browse the repository at this point in the history
  • Loading branch information
pjfanning authored Jan 21, 2024
1 parent 76591c9 commit d2d81a9
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

package org.apache.pekko.pki.kubernetes

import java.io.File
import java.io.{ ByteArrayInputStream, File }
import java.nio.charset.StandardCharsets
import java.nio.file.Files
import java.security.{ KeyStore, PrivateKey }
Expand Down Expand Up @@ -67,7 +67,8 @@ private[pekko] object PemManagersProvider {
* INTERNAL API
*/
@InternalApi def loadCertificates(filename: String): Iterable[Certificate] = blocking {
certFactory.generateCertificates(Files.newInputStream(new File(filename).toPath)).asScala
val bytes = Files.readAllBytes(new File(filename).toPath)
certFactory.generateCertificates(new ByteArrayInputStream(bytes)).asScala
}

}

0 comments on commit d2d81a9

Please sign in to comment.