WebRequest
-
Error ------------ The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. ------------- i try to use this code but i have error *************** using System; using System.IO; using System.Net; using System.Text; namespace Examples.System.Net { public class WebRequestGetExample { public static void Main() { // Create a request for the URL. WebRequest request = WebRequest.Create("https://isp.paltel.net/login.cfm"); // If required by the server, set the credentials. request.PreAuthenticate = true; request.Credentials = CredentialCache.DefaultCredentials; // Get the response. HttpWebResponse response = (HttpWebResponse)request.GetResponse(); // Display the status. Console.WriteLine(response.StatusDescription); // Get the stream containing content returned by the server. Stream dataStream = response.GetResponseStream(); // Open the stream using a StreamReader for easy access. StreamReader reader = new StreamReader(dataStream); // Read the content. string responseFromServer = reader.ReadToEnd(); // Display the content. Console.WriteLine(responseFromServer); // Cleanup the streams and the response. reader.Close(); dataStream.Close(); response.Close(); Console.Read(); } } } ***************
Palestine
-
Error ------------ The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. ------------- i try to use this code but i have error *************** using System; using System.IO; using System.Net; using System.Text; namespace Examples.System.Net { public class WebRequestGetExample { public static void Main() { // Create a request for the URL. WebRequest request = WebRequest.Create("https://isp.paltel.net/login.cfm"); // If required by the server, set the credentials. request.PreAuthenticate = true; request.Credentials = CredentialCache.DefaultCredentials; // Get the response. HttpWebResponse response = (HttpWebResponse)request.GetResponse(); // Display the status. Console.WriteLine(response.StatusDescription); // Get the stream containing content returned by the server. Stream dataStream = response.GetResponseStream(); // Open the stream using a StreamReader for easy access. StreamReader reader = new StreamReader(dataStream); // Read the content. string responseFromServer = reader.ReadToEnd(); // Display the content. Console.WriteLine(responseFromServer); // Cleanup the streams and the response. reader.Close(); dataStream.Close(); response.Close(); Console.Read(); } } } ***************
Palestine
This must be the seventh time you're asking the same question in the last few days. Last time kubben asked you if you have tried HttpWebRequest.ClientCertificates and you didn't answer. HAVE YOU??