using (WebClient wc = new WebClient()) {
string pageSourceCode = webclient.DownloadString("https://hostname");
}
I have added the certificate (self-signed) used on the web server to "Trusted Root Certification Authorities" on local computer, but still get the exception "The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.", how come?
Edit: Seems to be working now after removing and then reinstalling the certificate.