Domanda

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.

È stato utile?

Soluzione

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....

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top