Код: Выделить всё
clientCerts = new X509CertificateCollection(new[] { as X509Certificate });
stream.AuthenticateAsClientAsync(, clientCerts, SslProtocols.Tls12, false); // Continuation omitted
Код: Выделить всё
Handshake Protocol: Certificate Request
Handshake Type: Certificate Request (13)
Length: 19
Certificate types count: 2
Certificate types (2 types)
Certificate type: RSA Sign (1)
Certificate type: ECDSA Sign (64)
Signature Hash Algorithms Length: 12
Signature Hash Algorithms (6 algorithms)
Signature Algorithm: rsa_pkcs1_sha384 (0x0501)
Signature Algorithm: ecdsa_secp384r1_sha384 (0x0503)
Signature Algorithm: rsa_pkcs1_sha256 (0x0401)
Signature Algorithm: ecdsa_secp256r1_sha256 (0x0403)
Signature Algorithm: rsa_pkcs1_sha1 (0x0201)
Signature Algorithm: ecdsa_sha1 (0x0203)
Distinguished Names Length: 0
Код: Выделить всё
Handshake Protocol: Certificate
Handshake Type: Certificate (11)
Length: 3
Certificates Length: 0
Код: Выделить всё
var ecdsa = ECDsa.Create();
var req = new CertificateRequest($"cn={name}", ecdsa, HashAlgorithmName.SHA256);
var generatedCert= req.CreateSelfSigned(DateTimeOffset.Now, DateTimeOffset.Now.AddYears(1));
using (var store = new X509Store(StoreName.My, StoreLocation.CurrentUser)) {
store.Open(OpenFlags.ReadWrite);
store.Add(generatedCert);
// Do stuff....
store.Remove(generatedCert);
}
Код: Выделить всё
Event Name Time MSec Process Name Rest
Microsoft-System-Net-Security/CertIsType2 12,600.157 Process(84336) (84336) ThreadID="38,972" ProcessorNumber="6" secureChannelHash="23,128,995" FormattedMessage="Certificate is of type X509Certificate2 and contains the private key."
Microsoft-System-Net-Security/SelectedCert 12,631.155 Process(84336) (84336) ThreadID="38,972" ProcessorNumber="6" clientCertificate="" secureChannelHash="23,128,995" FormattedMessage="Selected certificate: ."
Сервер запросил аутентификацию клиента, но либо предоставленные учетные данные не включают сертификат, либо сертификат не был выдан центром сертификации, которому доверяет сервер.
Ну... как я могу узнать, чему доверяет сервер, не отправляя его для проверки по сети? Другая сторона — это код, над которым я тоже работаю, поэтому знаю, что он ожидает анализа сообщения сертификата и проверки сертификата, но не может, потому что сертификат не отправлен. Я не понимаю, что мне здесь делать?
Подробнее здесь: https://stackoverflow.com/questions/628 ... ertificate
Мобильная версия