This commit is contained in:
11
main.go
11
main.go
@@ -8,8 +8,7 @@ import (
|
|||||||
auth "github.com/korylprince/go-ad-auth/v3"
|
auth "github.com/korylprince/go-ad-auth/v3"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const WSDCCertPem = `
|
||||||
const WSDCCertPem := `
|
|
||||||
-----BEGIN CERTIFICATE-----
|
-----BEGIN CERTIFICATE-----
|
||||||
MIIJZzCCCE+gAwIBAgIKYQTouAAAAAAABzANBgkqhkiG9w0BAQsFADCBpzELMAkG
|
MIIJZzCCCE+gAwIBAgIKYQTouAAAAAAABzANBgkqhkiG9w0BAQsFADCBpzELMAkG
|
||||||
A1UEBhMCQVUxDDAKBgNVBAgTA05TVzEPMA0GA1UEBxMGU3lkbmV5MSQwIgYDVQQK
|
A1UEBhMCQVUxDDAKBgNVBAgTA05TVzEPMA0GA1UEBxMGU3lkbmV5MSQwIgYDVQQK
|
||||||
@@ -73,9 +72,13 @@ func main() {
|
|||||||
password := flag.String("password", "pass", "Password to use when attempting to bind to AD")
|
password := flag.String("password", "pass", "Password to use when attempting to bind to AD")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
// Add custom certificate to the system cert pool
|
// Get a copy of the system defined CA's
|
||||||
system := x509.SystemCertPool()
|
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))
|
ok := system.AppendCertsFromPEM([]byte(WSDCCertPem))
|
||||||
if !ok {
|
if !ok {
|
||||||
panic("failed to parse WSDC intermediate certificate")
|
panic("failed to parse WSDC intermediate certificate")
|
||||||
|
Reference in New Issue
Block a user