Skip to content

Commit

Permalink
(SERVER-2550) Process InputStream into ByteArrayStream
Browse files Browse the repository at this point in the history
The utilities for turning pems into PKI objects cannot handle a basic
input stream. This commit converts the input from the endpoint into a
ByteArrayInputStream, which is handled correctly by the ssl-utils
helpers.
  • Loading branch information
Magisus committed May 21, 2021
1 parent e4145e8 commit f83e3d1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/clj/puppetlabs/services/ca/certificate_authority_core.clj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(ns puppetlabs.services.ca.certificate-authority-core
(:import [java.io InputStream]
(:import [java.io InputStream ByteArrayInputStream]
(clojure.lang IFn)
(org.joda.time DateTime))
(:require [puppetlabs.puppetserver.certificate-authority :as ca]
Expand Down Expand Up @@ -100,7 +100,10 @@
{:keys [cacrl cacert enable-infra-crl infra-crl-path]} :- ca/CaSettings]
(locking crl-write-serializer
(try
(let [incoming-crls (utils/pem->crls incoming-crl-pem)]
(let [byte-stream (-> incoming-crl-pem
ca/input-stream->byte-array
ByteArrayInputStream.)
incoming-crls (utils/pem->crls byte-stream)]
(ca/update-crls incoming-crls cacrl cacert)
(when enable-infra-crl
(ca/update-crls incoming-crls infra-crl-path cacert)))
Expand Down

0 comments on commit f83e3d1

Please sign in to comment.