mirror of
https://gitea.com/gitea/runner.git
synced 2026-11-17 13:23:43 +00:00
1 parent
f98caa2656
commit
320e9b6057
1274 files changed
+398630
-9
No files matched your search
+18
@@ -0,0 +1,18 @@
|
||||
// +build go1.7
|
||||
|
||||
package tlsconfig
|
||||
|
||||
import (
|
||||
"crypto/x509"
|
||||
"runtime"
|
||||
)
|
||||
|
||||
// SystemCertPool returns a copy of the system cert pool,
|
||||
// returns an error if failed to load or empty pool on windows.
|
||||
func SystemCertPool() (*x509.CertPool, error) {
|
||||
certpool, err := x509.SystemCertPool()
|
||||
if err != nil && runtime.GOOS == "windows" {
|
||||
return x509.NewCertPool(), nil
|
||||
}
|
||||
return certpool, err
|
||||
}
|
||||
Reference in new issue
Block a user