SSL-связь для поддержки сертификата CA (сертификат открытого ключа)C++

Программы на C++. Форум разработчиков
Ответить
Anonymous
 SSL-связь для поддержки сертификата CA (сертификат открытого ключа)

Сообщение Anonymous »


For the SSL communication with the certificate for the below C/C++ code link how to support the CA certificate (public key certificate which is exported from the site info)

https://github.com/microsoft/Windows-cl ... ntCert.cpp

WS_SSL_TRANSPORT_SECURITY_BINDING sslBinding = {}; // zero out the struct sslBinding.binding.bindingType = WS_SSL_TRANSPORT_SECURITY_BINDING_TYPE; // set the binding type // Set up the client certificate. The certificate must have been registered beforehand. static const WS_STRING certStore = WS_STRING_VALUE(L"My"); static const WS_STRING certSubjectName = WS_STRING_VALUE(L"CN=client.com"); WS_SUBJECT_NAME_CERT_CREDENTIAL certBySubject; certBySubject.credential.credentialType = WS_SUBJECT_NAME_CERT_CREDENTIAL_TYPE; certBySubject.storeLocation = CERT_SYSTEM_STORE_CURRENT_USER; certBySubject.storeName = certStore; certBySubject.subjectName = certSubjectName; sslBinding.localCertCredential = &certBySubject.credential; // declare and initialize the array of all security bindings WS_SECURITY_BINDING* securityBindings[1] = { &sslBinding.binding }; For the Above Sample code with my CA certificate(Public key certificate exported from site info) i am getting error as below:

"There was an error communicating with the endpoint at 'https://localhost:8444'. No credentials were available in the client certificate"

Please Suggest how to support the CA certificate for the SSL communication ?.
  • I am able to establish a communication with the certificate with private keys.

how to support / code changes to add the properties to support the CA certificate/ public certificate.


Источник: https://stackoverflow.com/questions/781 ... ertificate
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «C++»