AppliStation
修订版 | f08a5340428b46497422083c6e858182099da04f (tree) |
---|---|
时间 | 2017-10-10 00:32:30 |
作者 | ttp <ttp@user...> |
Commiter | ttp |
na-get-lib,TLS関連のエラーメッセージを修復。TLSv1.0は現時点では有効とする
@@ -171,10 +171,14 @@ namespace NaGet.SubCommands.SubTask | ||
171 | 171 | |
172 | 172 | RaiseTaskSetEvent(TaskEventType.COMPLETED, "ダウンロード終了", 100); |
173 | 173 | } catch (System.Net.WebException e) { |
174 | - if (System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable()) { | |
174 | + if ((e.InnerException != null) && | |
175 | + (e.InnerException.InnerException != null) && | |
176 | + (e.InnerException.InnerException is System.Security.Authentication.AuthenticationException)) { | |
177 | + RaiseTaskSetEvent(TaskEventType.WARNING, "接続を試みましたが、認証またはTLS(SSL)接続に失敗しました。", -1); | |
178 | + } else if (!System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable()) { | |
175 | 179 | RaiseTaskSetEvent(TaskEventType.WARNING, "ネットワークに接続されていません。", -1); |
176 | 180 | } else { |
177 | - RaiseTaskSetEvent(TaskEventType.WARNING, "ネットワークに接続できませんでした。ネットワークが切断されているか、ファイアウォールによって遮断された可能性があります。", -1); | |
181 | + RaiseTaskSetEvent(TaskEventType.WARNING, "サーバに接続できませんでした。切断されたか、ファイアウォールによって遮断された可能性があります。", -1); | |
178 | 182 | } |
179 | 183 | throw new System.Net.WebException(e.Message, e); |
180 | 184 | } finally { |
@@ -15,11 +15,15 @@ namespace NaGet.SubCommands.SubTask | ||
15 | 15 | NotifyStarted(); |
16 | 16 | RaiseTaskSetEvent(TaskEventType.STARTED, "セキュリティプロトコル設定の確認", 0); |
17 | 17 | |
18 | + // SSLv3無効化 | |
18 | 19 | if ((ServicePointManager.SecurityProtocol & SecurityProtocolType.Ssl3) != 0) { |
19 | 20 | ServicePointManager.SecurityProtocol &= ~SecurityProtocolType.Ssl3; |
20 | 21 | RaiseTaskSetEvent(TaskEventType.PING, string.Empty, 33); |
21 | 22 | } |
22 | 23 | |
24 | + // TLSv1.0有効化 | |
25 | + ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls; | |
26 | + | |
23 | 27 | try { |
24 | 28 | ServicePointManager.SecurityProtocol |= (SecurityProtocolType)768; // SecurityProtocolType.Tls11 |
25 | 29 | RaiseTaskSetEvent(TaskEventType.PING, string.Empty, 66); |