我正在调用我们的服务器,它将检查用户的身份验证,如果是有效用户,它将返回会话ID。服务器的url是https...
我已经向server..It发出了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){}}我参考了很多论坛,但似乎没有用。
发布于 2012-10-23 15:44:29
出现此问题是因为服务器证书已更改.....因此,我需要手动安装ssl证书...我通过在移动浏览器中通过邮件下载ssl证书url作为附件并安装它来实现这一点。
https://stackoverflow.com/questions/12969168
复制相似问题