bugfix
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Nathan Coad
2023-07-19 14:54:28 +10:00
parent 062aebe299
commit db0b104a58

11
main.go
View File

@@ -8,8 +8,7 @@ import (
auth "github.com/korylprince/go-ad-auth/v3"
)
const WSDCCertPem := `
const WSDCCertPem = `
-----BEGIN CERTIFICATE-----
MIIJZzCCCE+gAwIBAgIKYQTouAAAAAAABzANBgkqhkiG9w0BAQsFADCBpzELMAkG
A1UEBhMCQVUxDDAKBgNVBAgTA05TVzEPMA0GA1UEBxMGU3lkbmV5MSQwIgYDVQQK
@@ -73,9 +72,13 @@ func main() {
password := flag.String("password", "pass", "Password to use when attempting to bind to AD")
flag.Parse()
// Add custom certificate to the system cert pool
system := x509.SystemCertPool()
// Get a copy of the system defined CA's
system, err := x509.SystemCertPool()
if err != nil {
panic("failed to access system CA list")
}
// Add custom certificate to the system cert pool
ok := system.AppendCertsFromPEM([]byte(WSDCCertPem))
if !ok {
panic("failed to parse WSDC intermediate certificate")