Revision | 103 (tree) |
---|---|
Zeit | 2019-07-27 16:52:16 |
Autor | ![]() |
サーバー証明書を無条件に受け付ける
@@ -17,6 +17,8 @@ | ||
17 | 17 | using EWatch.Watchers; |
18 | 18 | using log4net; |
19 | 19 | using log4net.Config; |
20 | +using System.Security.Cryptography.X509Certificates; | |
21 | +using System.Net.Security; | |
20 | 22 | |
21 | 23 | namespace EWatch |
22 | 24 | { |
@@ -106,6 +108,10 @@ | ||
106 | 108 | public void Initialize() |
107 | 109 | { |
108 | 110 | config = new Configuration(true, ConfigFile); |
111 | + System.Net.ServicePointManager.ServerCertificateValidationCallback = | |
112 | + delegate(object s, X509Certificate cert, X509Chain chain, SslPolicyErrors errors){ | |
113 | + return true; | |
114 | + }; | |
109 | 115 | } |
110 | 116 | |
111 | 117 | public void StartWatch() |