On client side:
generate necessary pem files:
(1) private key/certificate pem file:
openssl pkcs12 -in in_file.p12 -clcerts -out key_out_file.pem
(2) generate CA certificate pem file (NOTE: Do NOT use -clcerts here, because the fifth parameter of soap_ssl_client_context requires a CA certificate):
openssl pkcs12 -in in_file.p12 -cacerts -out cert_out_file.pem
(3) use in soap_ssl_client_context()
if (soap_ssl_client_context( &soap,
SOAP_SSL_DEFAULT,
"key_out_file.pem",
"your_pw",
"cert_out_file.pem",
NULL,
NULL))
{ // print ... error }
No comments:
Post a Comment