Problems with https on iPad from Air app

2019-08-05 04:32发布

问题:

I have developed an in-house Air app for the iPad that tries to connect to a jetty web server via SSL (https) using HTTPService. Even the simplest GET returns error #2032 (runs OK with plain http).

I have checked the obvious things: URL is correct, certificate is correct and correctly installed, I am using the right port, which is open. As a matter of fact, the URL can be accessed from Safari on the iPad without problems. It also runs correctly on adl.

I am using an iPad 2 with iOS 5. The application was built with Air 4.6.

Any ideas?

回答1:

you have posted in my Thread. I found a solution for this problem by myself. it works fine for me.

If you have a certificate which is signed by a third company it should work. if not, do the following steps:

First I have changed the contentType from the loader ( I use the HTTPService from Flex) to "application/x-www-form-urlencoded"; but I think its only important in my case.

Second created a StageWebView, place it on stage and give it a viewport outside the screen. Than call the function loadURL from the StageWebView with your https url on startup of the application.

If the application runs on an ios device, a dialog apears that ask you if you want to allow a selfsigned certificate. After you have accept the certificate the next request will work.

There are two disadvantages: • You have to accept the certificate on every new Startup of the app. • You first call (over the stageWebView) will not work. Because this calls the dialog and you cant dispatch the dialog input. So you have to handle it by yourself that you make your HTTPS request after that dialog.



回答2:

https is not yet supported in mobile Air applications



回答3:

Contrary to what @Eduardo posted, HTTPS works just fine in AIR, as long as the certificate is valid.



回答4:

You need to upgrade your AIR version from 3.1 to latest one. Adobe AIR 3.2 also supports self signed certificate.