Skip to content

Commit

Permalink
Fixes in bundle.pem
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxim Pogozhiy committed Nov 3, 2017
1 parent 51d7be9 commit b247e08
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/cfssl/cfssl.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ func New(kubecfssl kubecfssl.KubeCfssl) *Cfssl {

func (c *Cfssl) getBundle() {
c.certificateData[kubecfssl.BundleCertificateName] = []byte(string(string(c.certificateData[kubecfssl.CertificateName]) +
string(c.certificateData[kubecfssl.RootCertificateName]) +
string(c.certificateData[kubecfssl.CertificateKeyName])))
string(c.certificateData[kubecfssl.RootCertificateName]) + "\n" +
string(c.certificateData[kubecfssl.CertificateKeyName])))
}

func (c *Cfssl) GetCertificate(pkiURL string, authKey string, csrConfig string) map[string][]byte {
Expand All @@ -58,7 +58,6 @@ func (c *Cfssl) certificateRequest (pkiURL string, authKey string,csrConfig stri
client := &http.Client{}
resp, err := client.Do(req)
c.checkError(err)
defer resp.Body.Close()

return resp
}
Expand Down Expand Up @@ -136,7 +135,6 @@ func (c *Cfssl) constructAuthRequest(key string, request []byte) string {
reqJson, _ := json.Marshal(reqData)
jsonStr := string(reqJson)
c.Log().Infoln("Processing certificate request")

c.Log().Debugln("JSON Request: ", string(jsonStr))
return jsonStr
}
Expand All @@ -149,8 +147,10 @@ func (c *Cfssl) ComputeHmac256(message []byte, secret string) string {
}

func (c *Cfssl) getCRT(resp *http.Response) []byte {

if resp.StatusCode == 200 {
body, _ := ioutil.ReadAll(resp.Body)

var response Response
json.Unmarshal([]byte(body), &response)
c.Log().Infoln("Certificate generation complete")
Expand Down

0 comments on commit b247e08

Please sign in to comment.