Web Server 使用WebClient 发送https请求 The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel
2015-04-22 15:43
232 查看
使用WebClient 发送https请求
使用WebClient发送请求时,并且是以https协议;
WebClient webClient = new WebClient();
string result = webClient.DownloadString(url);
error : The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel
只需一行代码:
ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };//获取或设置用于验证服务器证书的回调。[SSL]
每个问题都有解决之法,遇到问题不要怕,解决问题才是提升最快的。
--------------------------------送给每天和bug打交道的博友们
使用WebClient发送请求时,并且是以https协议;
WebClient webClient = new WebClient();
string result = webClient.DownloadString(url);
error : The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel
只需一行代码:
ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };//获取或设置用于验证服务器证书的回调。[SSL]
每个问题都有解决之法,遇到问题不要怕,解决问题才是提升最快的。
--------------------------------送给每天和bug打交道的博友们
相关文章推荐
- PHP中使用cURL发送http/https请求
- 使用HttpsURLConnection发送POST请求
- httpclient4.x 使用连接池发送https请求
- 使用Apache提供的HttpClient发送https请求
- c#使用Socket发送HTTP/HTTPS请求的实现代码
- C# 中使用WebClient 请求 https
- c++使用curl库发送https请求
- 使用spring-web中的api发送http或https请求的代码
- Android开发中,使用https发送安全请求的实现
- 使用HttpClient发送HTTPS请求以及配置Tomcat支持SSL
- (转) httpclient4.x 使用连接池发送https请求使用总结
- 使用HttpsURLConnection发送POST请求
- 使用java 发送https 协议请求
- 使用HttpsURLConnection发送POST请求
- 使用HttpClient发送HTTPS请求以及配置Tomcat支持SSL
- 使用HttpClient向HTTPS地址发送POST请求4.1.2
- 使用JDK自带HttpsURLConnection发送HTTPS请求
- 使用java发送https的请求
- 使用HttpClient发送https请求GET方式