title: c# webclient upload and download data from ssl
body: <p>I have a wamp server on windows. SSL configured correctly. In browser it is working threw https: . I have a script test.php and I want to download and upload some POST data to it. I have my c# code:</p>
  
  <pre><code>WebClient client = new WebClient();
  client.Encoding = Encoding.UTF8;
  NameValueCollection values = new NameValueCollection();
  values.Add("paramtest", "testval");
  ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
  client.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
  byte[] result;   
  result = client.UploadValues("https://127.0.0.1./test.php", "POST", values); 
  string htmlCode = Encoding.UTF8.GetString(result);
  textBox1.Text = htmlCode;
  </code></pre>
  
  <p>When runnign this code with http I got all the data. When put https, I got an error from the server:</p>
  
  <blockquote>
    <p> 
    400 Bad Request  <h1>Bad Request</h1>
    <p>Your browser sent a request that this server could not
    understand.<br /> </p> </p>
  </blockquote>
  
  <p>Have you got any idea how can I fix it?</p>