From: ttp Date: Mon, 9 Oct 2017 15:32:30 +0000 (+0900) Subject: na-get-lib,TLS関連のエラーメッセージを修復。TLSv1.0は現時点では有効とする X-Git-Tag: v1.4.6b2 X-Git-Url: http://git.sourceforge.jp/view?p=applistation%2FAppliStation.git;a=commitdiff_plain;h=f08a5340428b46497422083c6e858182099da04f na-get-lib,TLS関連のエラーメッセージを修復。TLSv1.0は現時点では有効とする --- diff --git a/na-get-lib/NaGet.SubCommands.SubTask/DownloadSubTask.cs b/na-get-lib/NaGet.SubCommands.SubTask/DownloadSubTask.cs index c1ff3e4..a0b4552 100644 --- a/na-get-lib/NaGet.SubCommands.SubTask/DownloadSubTask.cs +++ b/na-get-lib/NaGet.SubCommands.SubTask/DownloadSubTask.cs @@ -171,10 +171,14 @@ namespace NaGet.SubCommands.SubTask RaiseTaskSetEvent(TaskEventType.COMPLETED, "ダウンロード終了", 100); } catch (System.Net.WebException e) { - if (System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable()) { + if ((e.InnerException != null) && + (e.InnerException.InnerException != null) && + (e.InnerException.InnerException is System.Security.Authentication.AuthenticationException)) { + RaiseTaskSetEvent(TaskEventType.WARNING, "接続を試みましたが、認証またはTLS(SSL)接続に失敗しました。", -1); + } else if (!System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable()) { RaiseTaskSetEvent(TaskEventType.WARNING, "ネットワークに接続されていません。", -1); } else { - RaiseTaskSetEvent(TaskEventType.WARNING, "ネットワークに接続できませんでした。ネットワークが切断されているか、ファイアウォールによって遮断された可能性があります。", -1); + RaiseTaskSetEvent(TaskEventType.WARNING, "サーバに接続できませんでした。切断されたか、ファイアウォールによって遮断された可能性があります。", -1); } throw new System.Net.WebException(e.Message, e); } finally { diff --git a/na-get-lib/NaGet.SubCommands.SubTask/SecurityProtocolConfigSubTask.cs b/na-get-lib/NaGet.SubCommands.SubTask/SecurityProtocolConfigSubTask.cs index fdfc096..ec04e9b 100644 --- a/na-get-lib/NaGet.SubCommands.SubTask/SecurityProtocolConfigSubTask.cs +++ b/na-get-lib/NaGet.SubCommands.SubTask/SecurityProtocolConfigSubTask.cs @@ -15,11 +15,15 @@ namespace NaGet.SubCommands.SubTask NotifyStarted(); RaiseTaskSetEvent(TaskEventType.STARTED, "セキュリティプロトコル設定の確認", 0); + // SSLv3無効化 if ((ServicePointManager.SecurityProtocol & SecurityProtocolType.Ssl3) != 0) { ServicePointManager.SecurityProtocol &= ~SecurityProtocolType.Ssl3; RaiseTaskSetEvent(TaskEventType.PING, string.Empty, 33); } + // TLSv1.0有効化 + ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls; + try { ServicePointManager.SecurityProtocol |= (SecurityProtocolType)768; // SecurityProtocolType.Tls11 RaiseTaskSetEvent(TaskEventType.PING, string.Empty, 66);