2018-09-06から1日間の記事一覧

.netのHTTPS通信で System.Net.WebException: 接続が切断されました: 送信時に、予期しないエラーが発生しました。 とエラーがでたら TLS1.2にすればOK

WebClientでアクセスしたら例外がでた。 TLS1.0、1.1の廃止が原因らしい。TLS1.2にするには ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; 入れるだけで一応OK。 ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12…