|
@@ -657,7 +657,12 @@ namespace GxPress.Repository.Implement
|
|
// };
|
|
// };
|
|
// HttpClientHandler clientHandler = new HttpClientHandler();
|
|
// HttpClientHandler clientHandler = new HttpClientHandler();
|
|
// clientHandler.ServerCertificateCustomValidationCallback = (sender, cert, chain, sslPolicyErrors) => { return true; };
|
|
// clientHandler.ServerCertificateCustomValidationCallback = (sender, cert, chain, sslPolicyErrors) => { return true; };
|
|
- HttpClient httpClient = new HttpClient(); //http对象
|
|
|
|
|
|
+
|
|
|
|
+ var httpClientHandler = new HttpClientHandler();
|
|
|
|
+ // Return `true` to allow certificates that are untrusted/invalid
|
|
|
|
+ httpClientHandler.ServerCertificateCustomValidationCallback =
|
|
|
|
+ HttpClientHandler.DangerousAcceptAnyServerCertificateValidator;
|
|
|
|
+ HttpClient httpClient = new HttpClient(httpClientHandler); //http对象
|
|
HttpResponseMessage response = await httpClient.PostAsync(
|
|
HttpResponseMessage response = await httpClient.PostAsync(
|
|
$"{imServiceUrl}/users",
|
|
$"{imServiceUrl}/users",
|
|
new JsonContent(new { username = request.Phone, password = "123456", nickname = request.Name }));
|
|
new JsonContent(new { username = request.Phone, password = "123456", nickname = request.Name }));
|