OSDN Git Service

TLS1.1以降のみ有効なサーバーのHTTPS接続に失敗する問題を修正
authorKimura Youichi <kim.upsilon@bucyou.net>
Sun, 29 Oct 2017 10:29:24 +0000 (19:29 +0900)
committerKimura Youichi <kim.upsilon@bucyou.net>
Sun, 29 Oct 2017 10:29:24 +0000 (19:29 +0900)
修正前に発生していた例外 (階層は InnerException の順序):

HttpRequestException: An error occurred while sending the request.
  -> WebException: The underlying connection was closed: An unexpected error occurred on a send.
    -> IOException: Authentication failed because the remote party has closed the transport stream.

OpenTween/Connection/Networking.cs
OpenTween/Resources/ChangeLog.txt

index 830bf42..86e7142 100644 (file)
@@ -106,6 +106,10 @@ namespace OpenTween.Connection
             Networking.initialized = true;
 
             ServicePointManager.Expect100Continue = false;
+
+            // 明示的に指定しないと、デフォルトでは SSL3.0, TLS1.0 のみ有効となる (.NET Framework 4.5.1)
+            // https://blogs.technet.microsoft.com/jpieblog/2015/04/07/net-framework-tls1-1-1-2/
+            ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
         }
 
         public static void SetWebProxy(ProxyType proxyType, string proxyAddress, int proxyPort,
index 05f6485..62ca51c 100644 (file)
@@ -10,6 +10,7 @@
  * CHG: 最新バージョン情報の取得に使用するURLを変更 (HTTPS接続を使用する)
  * FIX: 起動時に復元したウィンドウ位置が画面領域外であった場合に、強制的にウィンドウを移動する動作が機能しない不具合を修正
  * FIX: TweetDeckから投稿されたツイートをFav追加・削除した場合にエラーが発生する問題を回避 (thx @Lolitapple!)
+ * FIX: TLS1.1以降のみ有効なサーバーのHTTPS接続に失敗する問題を修正
 
 ==== Ver 1.3.9(2017/08/14)
  * CHG: Twemoji v2.3.0 に対応しました