李昊 4 years ago
parent
commit
af52c3c437
1 changed files with 5 additions and 1 deletions
  1. 5 1
      GxPress/Repository/GxPress.Repository.Implement/UserRepository.cs

+ 5 - 1
GxPress/Repository/GxPress.Repository.Implement/UserRepository.cs

@@ -650,7 +650,11 @@ namespace GxPress.Repository.Implement
             {
                 var imServiceUrl = ConfigHelper.GetValue("ServiceAddress:ImUrl");
                 // var httpClientHandler = new HttpClientHandler { ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator };
-                HttpClient httpClient = new HttpClient(); //http对象
+                var httpClientHandler = new HttpClientHandler
+                {
+                    ServerCertificateCustomValidationCallback = (message, certificate2, arg3, arg4) => true
+                };
+                HttpClient httpClient = new HttpClient(httpClientHandler); //http对象
                 HttpResponseMessage response = await httpClient.PostAsync(
                     $"{imServiceUrl}/users",
                     new JsonContent(new { username = request.Phone, password = "123456", nickname = request.Name }));