views:

546

answers:

1

Hi,

In our flex/air application we are calling a web service over https. The web service is java based and has, at the moment, an untrusted certificate.

When doing a POST to the service with some json, the payload on the server side is pretty garbled. A popup does occur asking whether you want to continue and even when I do and add the untrusted certificate into my keychain (on the mac), the data sent through always comes through mangled.

I installed charles http proxy to see the actual traffic and it seems at times I'm getting a SSLHandshakeException back... I'm guessing this is causing the garbled data as ssl isn't being setup properly.

So, to the question - can air/flex handle untrusted certificates? Is there a workaround that you can do? For example in java with commons httpclient you can work around it at the socket level.

Thanks,

Kieran

+1  A: 

I don't know but it might help if you use the secure attribute in your server-side crossdomain.xml like this:

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd"&gt;
<cross-domain-policy>
  <allow-access-from domain="mydomain.com" secure="false" />
</cross-domain-policy>
Jochen Hilgers
at the mo, the http site is on an ipaddress with port number is that what needs to go in the place of the mydomain.com bit?
Kieran H
meh... being dull. as I want all addresses to be able to access the server, it should be a *
Kieran H
Jochen - cheers! that seems to have rectified the issue so far!
Kieran H
great...I'm glad that i could help
Jochen Hilgers
Argh... actually it seems to have helped, but not sorted permanently. According to the http wire logs I'm getting SSLHandshakeExceptions sporadically! The crossdomain.xml has helped but not fully resolved it, it seems.
Kieran H