Showing posts with label transport security. Show all posts
Showing posts with label transport security. Show all posts

Encrypt and Sign your SOAP messages in PHP

Thursday, August 14, 2008

I wrote a blog about How to Encrypt and Sign your SOAP Messages in PHP. You can find out the two basic choices you have in securing soap messages + some links on how to develop them.

Calling https service with WSClient

Wednesday, March 12, 2008

Past few days I saw several users have raised the question, how to call https services from WSClient. In order to call such kind of services, you need to have the server's Certificate Authoritys Certificate (CACert), and specify it in the construction of WSClient,

$client = new WSClient(array("to" => "https://somehost.com/somewhere/service",
"CACert" => "cert.pem"));

If for some reason you don't have the servers CACert you can use the server's certificate itself as the CACert. In order to obtain the server's certificate use the following command, (assuming you already have openssl installed)

openssl s_client -connect somehost.com:443
Note: you should change the somehost.com:443 to the servers name and port.

Then extract out the text between "-----BEGIN CERTIFICATE-----" to "-----END CERTIFICATE-----"(inclusive of those two lines too) and save them in a file (cert.pem),

This way your server will be validated and will do the service call securely.