簡體   English   中英

HTTPS請求僅針對Android使用Flex 4.6 Mobile返回2032流錯誤

[英]HTTPS request returning 2032 Stream Error only for Android with Flex 4.6 Mobile

我有一個針對iOS和Android的移動應用程序。 它通過HTTPS(使用帶有HTTPService的POST)發出登錄請求。在通過ADL在我的開發盒上進行調試時以及在iOS 4.2和iOS 5上進行編譯和測試時,一切正常。

從我的測試應用程序或設備的瀏覽器中向其他域(如Twitter等)發出HTTPS請求時,Android設備也能正常工作。

我只有幾個測試Android設備,他們運行2.3.3但沒有一個會成功連接。 通過USB進行調試時,我可以看到HTTPService調用正在返回帶有IOErrorEvent#2032的FaultEvent。

經過研究,我發現Android操作系統在某些SSL證書上存在一些問題,而在服務器上使用的發行者是“VeriSign Class 3 International Server CA - G3”,但我還沒有找到任何可行的解決方法/解決方案。 有人遇到過這種情況么? 我知道它非常具體。

只想添加在調度ioErrorEvent 2032之前立即返回HTTP狀態代碼0。 我已經檢查了Adobe的HTTP文檔以獲取HTTPStatusEvent,0似乎是默認的。 http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/events/HTTPStatusEvent.html

HTTPStatusEvent objects are always sent before error or completion events. An HTTPStatusEvent object does not necessarily indicate an error condition; it simply reflects the HTTP status code (if any) that is provided by the networking stack. Some Flash Player environments may be unable to detect HTTP status codes; a status code of 0 is always reported in these cases. Just wanted to add additional findings...through testing we were able to use that same certificate on another server - and despite security warnings, I was able to get data on my test Android device. This makes me think that the issue may be related to the server....It's hosted by Rackspace so we're going to reach out to them to attempt more troubleshooting.

我遇到了同樣的問題, https: requests上的Stream error 2032 ,並且能夠通過升級到更新的AIR運行時來解決它。 我注意到在一個測試設備上發生了錯誤,而不是另一個,主要的區別是有錯誤的安裝了AIR 3.1 ,沒有錯誤的安裝了AIR 3.2

我們現在使用強制AIR運行時(版本3.3 )打包應用程序。 由於FlashBuilderAIR 3.1 ,因此有必要下載新的AIR SDK並將其覆蓋在FlashBuilder

很奇怪。 結束了必須設置代理才能使其正常工作。

我剛剛使用AIR 25.0.0.134在Android上遇到過這個問題。 IOS和Desktop使用相同的代碼沒有問題。

我發現問題是我使用的URL有額外的(不可見)字符。 即%A0

解決方案是轉義url並刪除%A0的所有實例,然后unescape並繼續下載文件。

var url:String = String(escape(ev.target.data)).replace(/%0A/gi, ""); 
downloadThisFile(unescape(url));

不同的虛擬閃存查看器根據平台以不同方式解決此類錯誤。 最好的辦法是應用一堆錯誤處理程序,看看結果如何。

我將從這個長期運行的谷歌搜索結果中引用一個完整的“解決方案”: http//www.judahfrangipane.com/blog/2007/02/15/error-2032-stream-error/

嘗試偵聽HTTP_STATUS事件 ,然后為所有錯誤類型添加事件處理程序,以獲得更精細的響應級別。

例:

public function doRequest(url:String = "http://www.example.com/page.php?something=whatYouWant"):void {
   var fileRequest:URLRequest = new URLRequest(url);
   var myLoader:URLLoader = new URLLoader();

   myLoader.addEventListener(Event.COMPLETE, onLoaderReady);

   myLoader.addEventListener(HTTPStatusEvent.HTTP_STATUS, function(evt:Object):void{handleError(evt,"HTTPStatusEvent.HTTP_STATUS");});
   myLoader.addEventListener(IOErrorEvent.IO_ERROR, function(evt:Object):void{handleError(evt,"IOErrorEvent.IO_ERROR");});
   myLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, function(evt:Object):void{handleError(evt,"SecurityErrorEvent.SECURITY_ERROR");});
   myLoader.load(fileRequest);
}
private function handleError(evt:Object , listenerType = "Anonymus"):void{
   trace('handleError listenerType '+listenerType+'\nError: '+evt);
}

由於它是專門的Android,請確保為其添加適當的“權限”以使用Internet,檢測Manifest文件中的連接等:

<android>
    <manifestAdditions><![CDATA[
    <manifest>
        <!-- See the Adobe AIR documentation for more information about setting Google Android permissions -->
        <uses-permission android:name="android.permission.INTERNET"/>
        <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
        <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
    </manifest>
]]></manifestAdditions>
  </android>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM