Skip to content

Commit

Permalink
Merge pull request #128 from lixin9311/fix-self-sign
Browse files Browse the repository at this point in the history
Fix passing self signed cert via arg/env
  • Loading branch information
madeye committed Sep 20, 2019
2 parents bcd2ce1 + ff8deb0 commit ca36119
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ func readCertificate() ([]byte, error) {
return filesystem.ReadFile(*cert)
}
if *certRaw != "" {
return []byte(*certRaw), nil
certHead := "-----BEGIN CERTIFICATE-----"
certTail := "-----END CERTIFICATE-----"
fixedCert := certHead + "\n" + (*certRaw)[len(certHead):len(*certRaw)-len(certTail)] + "\n" + certTail
return []byte(fixedCert), nil
}
panic("thou shalt not reach hear")
}
Expand Down

0 comments on commit ca36119

Please sign in to comment.