Showing posts with label CACert. Show all posts
Showing posts with label CACert. Show all posts
Test your SSL SOAP Client with an Online Service
Tuesday, October 7, 2008
Do you know WSF/PHP Demo Site services are deployed as HTTPS Services as well. You can use these services to test WSClient. This post give you a little overview of this and a sample client code to call the service.
Testing https requests with WSClient
Tuesday, June 24, 2008
If any case you found your WSClient fails in sending https request, you can use the "https://6ec2.dyndns.org/samples/wsdl_mode/wsdl_11_service.php" service to test whether the problem is in your WSF/PHP installation or something else. What you need to do is edit the samples/wsdl_mode/wsdl_11_client.php so that your WSClient constructor have the following value.
$client = new WSClient(array("wsdl"=>"sample_wsdl_11.wsdl",
"to" => "https://6ec2.dyndns.org/samples/wsdl_mode/wsdl_11_service.php",
"CACert" => "server.crt"
));
Use the approach mentioned in this blog post to generate the above server.crt certifcate.
Then run the sample in the command prompt or shell
php wsdl_11_client.php and test whether the response comes as expected. if not you have to check the wsf/php instatllatioin steps again.
$client = new WSClient(array("wsdl"=>"sample_wsdl_11.wsdl",
"to" => "https://6ec2.dyndns.org/samples/wsdl_mode/wsdl_11_service.php",
"CACert" => "server.crt"
));
Use the approach mentioned in this blog post to generate the above server.crt certifcate.
Then run the sample in the command prompt or shell
php wsdl_11_client.php and test whether the response comes as expected. if not you have to check the wsf/php instatllatioin steps again.
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.
$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.
Labels:
CACert,
certificate,
https,
openssl,
transport security,
WSClient
Subscribe to:
Posts (Atom)