Skip to content
Advertisement

Soap service with an ssl certificate with password (PHP)

I need to access a SOAP service with a certificate protected by password. I’m new in PHP (with PHP 5.4 in CodeIgniter 2) and have tried some options that doesn’t work for me.

I have the following constants:

JavaScript

I have tried these options:

Option A

JavaScript

Options B

JavaScript

I have no idea how to add the password. Those solutions are what I found here on StackOverflow. In both examples I get the same error:

SoapClient::SoapClient(): Unable to find the wrapper “https” – did you forget to enable it when you configured PHP?

I have uncomented the “extension=php_openssl.dll” in php.ini

I’ve tried with these routes of cert:

JavaScript

Does anyone have an idea about what can I do. Thank you very much!

Advertisement

Answer

first of all you need to convert .p12 to .pem
in Linux you can do it with following command
openssl pkcs12 -in Certificados.p12 -out Certificados.pem -clcerts

then try the following:

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement