Add system certs to bonafide

lilypad/float is now using letsencrypt certs for vpnweb so instead of
instantiating an empty cert pool, we can just use the system pool and
then add the manually configured cert for backwards compatibility.
merge-requests/165/merge
max b 3 months ago committed by atanarjuat
parent da0621717b
commit 14cf64b10a

@ -97,7 +97,11 @@ func getAPIAddr(provider string) string {
// New Bonafide: Initializes a Bonafide object. By default, no Credentials are passed.
func New() *Bonafide {
certs := x509.NewCertPool()
certs, err := x509.SystemCertPool()
if err != nil {
log.Println("Error loading SystemCertPool, falling back to empty pool")
certs = x509.NewCertPool()
}
certs.AppendCertsFromPEM(config.CaCert)
client := &http.Client{
Transport: &http.Transport{

Loading…
Cancel
Save