【问题标题】:https throws "the remote server not found" windows phone 7https抛出“找不到远程服务器” windows phone 7
【发布时间】:2012-10-19 07:13:50
【问题描述】:

我正在调用我们的服务器,它将检查用户的身份验证,如果是有效用户,它将返回一个会话 ID。服务器的url是https...

我已经对服务器进行了 httpwebrequest 调用(以及尝试过的 webclient)。它工作正常,但最近服务器的证书已更新,现在我无法访问服务器。它抛出异常服务器不是找到了……

下面是我的代码......

private void LoginRequest()
        {
            try
            {

         var httpLoginRequest = (HttpWebRequest)WebRequest.Create(new Uri("https:xxxxx"                             + "?" +"username=" + UserName_textBox.Text + "&" + "password="+ Password_textBox.Password));
                httpLoginRequest.Method = DisplayMessage.Get_Method;
                Parameters = new Dictionary<string, string>();
                httpLoginRequest.BeginGetResponse(new AsyncCallback(GetLoginCallback), httpLoginRequest);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        private void GetLoginCallback(IAsyncResult asynchronousResult)
        {
            try
            {
               HttpWebRequest httpRequest = HttpWebRequest)asynchronousResult.AsyncState;
               HttpWebResponse httpresponse = (HttpWebResponse)httpRequest.EndGetResponse(asynchronousResult);
                Stream streamResponse = httpresponse.GetResponseStream();
                using(StreamReader streamRead = new StreamReader(streamResponse))
                {
                    var response = streamRead.ReadToEnd(); 
                }
         }
catch(WebException ex){}}

我推荐了很多论坛,但似乎没有用。

【问题讨论】:

    标签: .net windows-phone-7-emulator


    【解决方案1】:

    由于服务器证书已更改而引发问题.....所以我需要手动安装 ssl 证书....我通过在我的移动浏览器中通过邮件下载 ssl 证书 url 作为附件来实现这一点并安装它....

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-12-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多