문제

Iam making call to our server which will checks authentication of a user and if valid user it will return an session ID. The url of the server is https...

I have made httpwebrequest call(as wel as tried webclient) to the server..It was working fine but recently the certificate of the server has been renewed and now iam unable to access the server.. It throws an exception server not found...

below is my code.......

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){}}

I had referred many forums, but seems to be no use.

도움이 되었습니까?

해결책

The problem was raised because the server certificate has been changed..... So iam in need to install the ssl certificate manually.... I achieved this by downloading the ssl certificate url through mail in my mobile browser as attachement and installing it....

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top