在我的公司环境中,有一个透明的代理,需要凭据才能访问Internet(每四个小时一次).在我的应用程序中,我成功通过了以下凭据:
var client = new WebClient();
client.Credientals = new NetworkCredential("username", "password");
string result = client.DownloadString("http://...");
// this works!
Run Code Online (Sandbox Code Playgroud)
但是,当我的初始请求是"https://"url时,会发生异常抛出:"底层连接已关闭:无法为SSL/TLS安全通道建立信任关系."
现在我目前的工作是:
我想知道是否有更好/更清洁的方法来做到这一点?