I have a REST web services call that uses a private SSL cert to
authenticate communication. It works in PHP and command line cUrl, but
I don't know how to pass the PEM file in the Flex 3 / Actionscript 3.0
HTTPService call. Is it possible? 

Below I give my PHP and cUrl snippets that work now, and followed by
the beginning of my Flex service call. How do I pass the PEM to that
Flex call so Flex can securely talk to the REST web service over this
private SSL cert?

-----
PHP
-----

This worked in PHP where $cert contained the path to the PEM file.

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_SSLCERT, $cert);

---------------------
cUrl (command line)
---------------------

This worked in command line cUrl, where client.pem contains a private
PEM file for privatesslcerthost.com.

curl ... --cert-type PEM --cert client.pem 

-----------
Flex code 
-----------

This needs to pass the PEM in the HTTPService call. How do I do it?

service = new HTTPService();
service.contentType = "text/xml";
service.resultFormat = "e4x";
service.useProxy = false;
service.method = "POST";
service.addEventListener(ResultEvent.RESULT, onRestCallResult);
service.addEventListener(FaultEvent.FAULT, onRestCallFault);
service.url = "https://privatesslcerthost.com/"; + path;
service.send(params);

Reply via email to