note 107591 added to class.soapclient
| From: | GuillermoPrandi | Date: | Mon, 20 Feb 2012 14:10:39 +0000 |
| Subject: | note 107591 added to class.soapclient | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-186236@lists.php.net to get a copy of this message | ||
To make an HTTPS call with a client certificate, you can do it this way:
1) Create a file containing both the key and the signed certificate. I did this by concatenating my
(.pem) key and the certificate I've got signed from my CA (also .pem format). The file looked
like this:
-----BEGIN RSA PRIVATE KEY-----
MIICXAIBAAKagQC1N27Ilb9pWil2NaX2qM8FquXBXK5T1AydOv7sCotsc8MAwbi7
......(snip)......
wAiOCD4K9TyMS76pIS8UyfJl/oIrn7EF24BUpaUfsh8=
-----END RSA PRIVATE KEY-----
-----BEGIN CERTIFICATE-----
MIIC/zCCAmigAwIBAgIEAIl1JzANBgkqhkiG9w0BAQQuADBQMQswCQYxVQQGEaJV
......(snip)......
eSPds1hLKYSg0bd3uI7LhaDLOC1PPgb77sYe/uYkUWuHBzllts5x/pfue0zaIBKG
Omjy
-----END CERTIFICATE-----
2) Reference your certificate in the creation of the SOAP client, like this:
$protected_url = "https://my-server/?wsdl";
$my_cert_file = "/my/path/to/mycert.pem";
$client = new SoapClient($protected_url, array('local_cert', $my_cert_file) );
----
Server IP: 201.216.232.3
Probable Submitter: 200.69.238.3
----
Manual Page -- http://www.php.net/manual/en/class.soapclient.php
Edit -- https://master.php.net/note/edit/107591
Del: integrated -- https://master.php.net/note/delete/107591/integrated
Del: useless -- https://master.php.net/note/delete/107591/useless
Del: bad code -- https://master.php.net/note/delete/107591/bad+code
Del: spam -- https://master.php.net/note/delete/107591/spam
Del: non-english -- https://master.php.net/note/delete/107591/non-english
Del: in docs -- https://master.php.net/note/delete/107591/in+docs
Del: other reasons-- https://master.php.net/note/delete/107591
Reject -- https://master.php.net/note/reject/107591
Search -- https://master.php.net/manage/user-notes.php