Answer the question
In order to leave comments, you need to log in
How to generate key.pem, cert.pem certificates from pfx or pem?
there is such code in golang and pfx and PEM certificates. I made pem from pfx. Wrote a request in PHP and the request passed.
cert, err := tls.LoadX509KeyPair("testdata/example-cert.pem", "testdata/example-key.pem")
defaultTransport := http.DefaultTransport.(*http.Transport)
tr := &http.Transport{
Proxy: defaultTransport.Proxy,
DialContext: defaultTransport.DialContext,
MaxIdleConns: 100,
IdleConnTimeout: 30 * time.Second,
ExpectContinueTimeout: defaultTransport.ExpectContinueTimeout,
TLSHandshakeTimeout: defaultTransport.TLSHandshakeTimeout,
TLSClientConfig: &tls.Config{
InsecureSkipVerify: true,
Certificates: []tls.Certificate{cert},
//RootCAs: caCertPool,
},
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question