Я получаю следующую ошибку: < /p>
Код: Выделить всё
The credentials supplied to the package were not recognized
< /code>
Я теперь загружаю сертификат общедоступного ключа владельцев сервера в мой магазин сертификатов Azure, в области «Сертификаты открытого ключа», и он работает. Мне уже нужно было игнорировать проверку на стороне сервера, так как мы подключаемся через IP -адрес, в отличие от URL. Это конфигурация: < /p>
var handler = new HttpClientHandler();
handler.ServerCertificateCustomValidationCallback =
(httpRequestMessage, cert, cetChain, policyErrors) =>
{
return true;
};
handler.SslProtocols = SslProtocols.Tls12;
handler.ClientCertificateOptions = ClientCertificateOption.Manual;
var certificate = new X509Certificate2(certificateData, password);
handler.ClientCertificates.Add(certificate);
using (var client = new HttpClient(handler))
{
...
}
< /code>
Итак, как добавление сертификата сервера делает что -либо? Что я пропустил?System.AggregateException: One or more errors occurred. (The SSL connection could not be established, see inner exception.)
System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception.
System.Security.Authentication.AuthenticationException: Authentication failed, see inner exception.
System.ComponentModel.Win32Exception (0x8009030D): The credentials supplied to the package were not recognized
Подробнее здесь: https://stackoverflow.com/questions/787 ... -use-a-cli