cmd/ski: update display mode
This commit is contained in:
@@ -399,15 +399,18 @@ func ParseOneCertificateFromPEM(certsPEM []byte) ([]*x509.Certificate, []byte, e
|
||||
// LoadFullCertPool returns a certificate pool with roots and intermediates
|
||||
// from disk. If no roots are provided, the system root pool will be used.
|
||||
func LoadFullCertPool(roots, intermediates string) (*x509.CertPool, error) {
|
||||
var err error
|
||||
|
||||
pool := x509.NewCertPool()
|
||||
|
||||
if roots == "" {
|
||||
pool, err := x509.SystemCertPool()
|
||||
pool, err = x509.SystemCertPool()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("loading system cert pool: %w", err)
|
||||
}
|
||||
} else {
|
||||
rootCerts, err := LoadCertificates(roots)
|
||||
var rootCerts []*x509.Certificate
|
||||
rootCerts, err = LoadCertificates(roots)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("loading roots: %w", err)
|
||||
}
|
||||
@@ -418,7 +421,8 @@ func LoadFullCertPool(roots, intermediates string) (*x509.CertPool, error) {
|
||||
}
|
||||
|
||||
if intermediates != "" {
|
||||
intCerts, err := LoadCertificates(intermediates)
|
||||
var intCerts []*x509.Certificate
|
||||
intCerts, err = LoadCertificates(intermediates)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("loading intermediates: %w", err)
|
||||
}
|
||||
|
||||
@@ -33,7 +33,6 @@ func parseURL(host string) (string, int, error) {
|
||||
// OK
|
||||
default:
|
||||
return "", 0, errors.New("certlib/hosts: only https scheme supported")
|
||||
|
||||
}
|
||||
|
||||
if url.Port() == "" {
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package hosts_test
|
||||
|
||||
import (
|
||||
"git.wntrmute.dev/kyle/goutils/certlib/hosts"
|
||||
"testing"
|
||||
|
||||
"git.wntrmute.dev/kyle/goutils/certlib/hosts"
|
||||
)
|
||||
|
||||
type testCase struct {
|
||||
|
||||
Reference in New Issue
Block a user