无法从ssl站点获取数据

时间:2013-05-07 07:26:04

标签: c# .net iis-7

好的,所以我在https://www.octgn.net使用通配符证书运行此服务器。 在每个浏览器中,我尝试一切正常,除了我有连接问题的用户。

这里主要关注的是我的软件中的api调用超过了ssl,而对于某些用户来说,它只是不起作用。这是我收集的例外

WARN  2013-05-07 16:18:12,562 3.1.18.102 [11] Octgn.Launcher.LoginNew [(null)] - Login Request Failed
System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive. ---> System.IO.IOException: The decryption operation failed, see inner exception. ---> System.ComponentModel.Win32Exception: The message received was unexpected or badly formatted
 --- End of inner exception stack trace ---
at System.Net.Security._SslStream.ProcessReadErrorCode(SecurityStatus errorCode, Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest, Byte[] extraBuffer)
at System.Net.Security._SslStream.ProcessFrameBody(Int32 readBytes, Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security._SslStream.StartFrameBody(Int32 readBytes, Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security._SslStream.StartFrameHeader(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security._SslStream.StartReading(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security._SslStream.ProcessRead(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.TlsStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.PooledStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead)
--- End of inner exception stack trace ---
at System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request)
at System.Net.WebClient.DownloadString(Uri address)
at Octgn.Launcher.LoginNew.<>c__DisplayClass14.<DoLogin>b__13() in c:\Program Files (x86)\Jenkins\workspace\OCTGN-Release\octgnFX\Octgn\Launcher\LoginNew.xaml.cs:line 269

我的代码看起来像这样

using (var wc = new WebClient())
{
    try
    {
        Log.Info("Sending login request");
        var ustring = AppConfig.WebsitePath + "api/user/login.php?username=" + HttpUtility.UrlEncode(username)
                      + "&password=" + HttpUtility.UrlEncode(password);
        if (email != null) ustring += "&email=" + HttpUtility.UrlEncode(email);
        var res = wc.DownloadString(new Uri(ustring));
        res = res.Trim();
        Log.Info("Do Login Request Result: " + res);
    }
    catch(Exception e)
    {
        Log.Warn("Login Request Failed",e);
        this.LoginFinished(LoginResult.Failure, DateTime.Now,"Please try again later.");
    }
}

有什么想法吗?我不确定这是不是我的错,也许我需要将我的公钥放在软件中并以某种方式将其注入我的电话,或者用户计算机设置有趣还是什么?

我能得到的每一个迹象都是我的ssl是正确的,我不是从很多用户那里得到的,但是每次都会发生这种情况,而且我不确定这里有什么问题。

更多信息: 引自用户

  

“Internet Explorer无法显示网页。”

     

但在其他所有浏览器上都能正常工作。“

另外,另一个引用

  

以下是我的SSL测试结果的屏幕截图:http://tinypic.com/view.php?pic=l9wtu&s=5

     

我尝试将https://*.octgn.net添加到IE。似乎没有什么区别。

     

如果有帮助,它会在登录页面上说我无法检索新闻标题。

新闻标题是服务器上的xml文档

调用服务器的应用程序也是客户端应用程序,它不是浏览器应用程序。

1 个答案:

答案 0 :(得分:0)

跨ssl的跨域请求可能存在问题。检查此链接。

http://www.voiceoftech.com/swhitley/index.php/2006/07/ssl-crossing-domains-and-flex/