Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. WebRequest

WebRequest

Scheduled Pinned Locked Moved C#
securitycsharpsysadminhelp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    TAREQ F ABUZUHRI
    wrote on last edited by
    #1

    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

    B 1 Reply Last reply
    0
    • T TAREQ F ABUZUHRI

      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

      B Offline
      B Offline
      blackjack2150
      wrote on last edited by
      #2

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

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups