Я следил за этим и создал услугу в обслуживании ткани. Сертификат был создан из KV. Я скачал сертификат с KV. И я пытаюсь позвонить с моей местной машины. Но я получаю 403 исключение. < /P>
var handler = new HttpClientHandler();
var bytes = File.ReadAllBytes(certPath);
var cert = new X509Certificate2(bytes);
handler.ClientCertificates.Add(cert);
var httpRequestMessage = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var httpClient = new HttpClient(handler);
var response = httpClient.SendAsync(httpRequestMessage).Result;
< /code>
Ошибки: < /p>
Exception:
Inner Exception 1:
HttpRequestException: An error occurred while sending the request.
Inner Exception 2:
WebException: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
Inner Exception 3:
AuthenticationException: The remote certificate is invalid according to the validation procedure.
Я следил за этим и создал услугу в обслуживании ткани. Сертификат был создан из KV. Я скачал сертификат с KV. И я пытаюсь позвонить с моей местной машины. Но я получаю 403 исключение. < /P> [code]var handler = new HttpClientHandler(); var bytes = File.ReadAllBytes(certPath); var cert = new X509Certificate2(bytes); handler.ClientCertificates.Add(cert); var httpRequestMessage = new HttpRequestMessage(HttpMethod.Get, apiUrl); var httpClient = new HttpClient(handler); var response = httpClient.SendAsync(httpRequestMessage).Result; < /code> Ошибки: < /p> Exception: Inner Exception 1: HttpRequestException: An error occurred while sending the request.
Inner Exception 2: WebException: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
Inner Exception 3: AuthenticationException: The remote certificate is invalid according to the validation procedure. [/code] Как сделать этот вызов?