如何在AIR应用程序中添加对特定SSL证书的支持

时间:2010-10-21 19:46:48

标签: javascript ssl https air

我需要在用Javascript编写的Adobe-AIR应用程序的iFrame中打开一个特定的SSL安全站点。

出于这个原因,我构建了一个小型测试应用程序,它在iFrame中打开网站 - 这很好用,但不接受服务器证书。弹出窗口显示并提示用户接受不受信任的证书。 服务器证书有效,由Trustcenter颁发,默认情况下在所有主要浏览器(Webkit,IE,FF,...)中被接受。那么为什么会这样呢?

为了确保服务器证书不是问题,我实施了另外两个相当常见的站点,只是为了查看他们的证书是否被接受。

嗯..我只需要我的应用程序接受我自己的服务器的ssl证书。 所以这是我的问题:如何让我的应用程序信任“它是家庭服务器”。

提前感谢您的意见。

编辑: 这是一些示例代码:

<html>
<head>
    <title>Prototype 1</title>
    <link href="sample.css" rel="stylesheet" type="text/css"/>
    <script type="text/javascript" src="lib/jquery/jquery-1.4.2.min.js"></script>
    <script type="text/javascript">
        var fbOpen = 0;
        function drawFb(link, sbRoot) {

            if (fbOpen != link) {
                fbOpen = link;
                $('#fbContainer').html('<iframe src="'+link+'" '
                                        +'width="700" height="480" ></iframe>')
                $('#fbContainer').show('slow');         
            }
            else {
                fbOpen = 0;
                $('#fbContainer').hide('slow');     
            }
        }
    </script>
</head>
<body style="background-color:yellow;padding:1em;">
    <h3>Example</h3>
    <p>Hi there! This is a basic example showing the usage of Iframes...</p>
    <input type="submit" onclick="drawFb('https://www.example.com/');" value="Test Own" />
    <input type="submit" onclick="drawFb('https://www.google.de/');" value="Test G" />
    <input type="submit" onclick="drawFb('https://www.adobe.com/');" value="Test A" />
    <div id="fbContainer" style="display:none;width:700px;height:480px;border:1px dashed red;"></div>
   </body>

2 个答案:

答案 0 :(得分:1)

您遇到的可能是“同源政策”。 也许adobe.com有效,因为核心组件已预先加载了adobe.com的来源?

在测试中确保iframe的服务器实际上与外部HTML页面相同。

这似乎是您如何配置这些特殊情况: http://livedocs.adobe.com/flex/3/html/help.html?content=ProgrammingHTMLAndJavaScript_11.html

答案 1 :(得分:1)

我认为这是Ubuntu 64-Bit上的AIR中的一个错误。当我在Vista,Win7或MacOS上测试应用程序时,该应用程序不会要求提供证书。

相关问题