]> Cypherpunks.ru repositories - ucspi.git/blobdiff - x509.go
Returned parsed certificates also in CertPoolFromFile
[ucspi.git] / x509.go
diff --git a/x509.go b/x509.go
index 8a5dd4eac910799dbb545a602184a4883fb15521..0743ba0b0c1734d2aab322a9d0fa850186f4807c 100644 (file)
--- a/x509.go
+++ b/x509.go
@@ -67,7 +67,7 @@ func PrivateKeyFromFile(p string) (prv interface{}, err error) {
        return
 }
 
-func CertPoolFromFile(p string) (pool *x509.CertPool, err error) {
+func CertPoolFromFile(p string) (certs []*x509.Certificate, pool *x509.CertPool, err error) {
        var data []byte
        data, err = ioutil.ReadFile(p)
        if err != nil {
@@ -90,6 +90,7 @@ func CertPoolFromFile(p string) (pool *x509.CertPool, err error) {
                if err != nil {
                        return
                }
+               certs = append(certs, ca)
                pool.AddCert(ca)
        }
        return