Skip to content

Commit

Permalink
Init (#5)
Browse files Browse the repository at this point in the history
* add code

* add ci

* fix dependency

* fix target repo

* fix cert reading

* fix
  • Loading branch information
wistefan authored Oct 18, 2022
1 parent 1878c81 commit c465e43
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,11 @@ func getEncodedCertificate(credentialsFolderPath string) (encodedCert []string,
return encodedCert, err
}

certString := strings.Trim(string(cert), "-----END CERTIFICATE-----")
certArray := strings.Split(certString, "-----BEGIN CERTIFICATE-----")
certString := strings.ReplaceAll(string(cert), "-----END CERTIFICATE-----\n", "")
certArray := strings.Split(certString, "-----BEGIN CERTIFICATE-----\n")

for i := range certArray {
certArray[i] = strings.Trim(certArray[i], "-----BEGIN CERTIFICATE-----")
certArray[i] = strings.ReplaceAll(certArray[i], "-----BEGIN CERTIFICATE-----\n", "")
}

return certArray, err
Expand Down

0 comments on commit c465e43

Please sign in to comment.