■ 例外「(407) Proxy Authentication Required」が発生する
エラー内容
System.Net.WebException:
The remote server returned an error: (407) Proxy Authentication Required
原因
* プロキシサーバで、ユーザ認証を設定しているが、その対応ができなかったため
対応策
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://yahoo.co.jp");
// ★この部分★ Proxyサーバ・ユーザ認証を使用している場合
request.Proxy.Credentials = new NetworkCredential("user_name", "password");
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
■ 例外「Could not establish trust relationship for the SSL/TLS secure channel」が発生する
エラー内容
System.Net.WebException:
The underlying connection was closed:
Could not establish trust relationship for the SSL/TLS secure channel.
原因
* SSL証明書がインポートされていなかったため
対応策
* SSL証明書がインポートする