зеркало из https://github.com/electron/electron.git
Fix passing certificate to select-client-certificate's callback
This commit is contained in:
Родитель
33978455b8
Коммит
23b92ef9ec
|
@ -132,19 +132,20 @@ void OnClientCertificateSelected(
|
||||||
std::shared_ptr<content::ClientCertificateDelegate> delegate,
|
std::shared_ptr<content::ClientCertificateDelegate> delegate,
|
||||||
mate::Arguments* args) {
|
mate::Arguments* args) {
|
||||||
mate::Dictionary cert_data;
|
mate::Dictionary cert_data;
|
||||||
if (!(args->Length() == 1 && args->GetNext(&cert_data))) {
|
if (!args->GetNext(&cert_data)) {
|
||||||
args->ThrowError();
|
args->ThrowError();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string encoded_data;
|
v8::Local<v8::Object> data;
|
||||||
cert_data.Get("data", &encoded_data);
|
if (!cert_data.Get("data", &data))
|
||||||
|
return;
|
||||||
|
|
||||||
auto certs =
|
auto certs = net::X509Certificate::CreateCertificateListFromBytes(
|
||||||
net::X509Certificate::CreateCertificateListFromBytes(
|
node::Buffer::Data(data), node::Buffer::Length(data),
|
||||||
encoded_data.data(), encoded_data.size(),
|
net::X509Certificate::FORMAT_AUTO);
|
||||||
net::X509Certificate::FORMAT_AUTO);
|
if (certs.size() > 0)
|
||||||
delegate->ContinueWithCertificate(certs[0].get());
|
delegate->ContinueWithCertificate(certs[0].get());
|
||||||
}
|
}
|
||||||
|
|
||||||
void PassLoginInformation(scoped_refptr<LoginHandler> login_handler,
|
void PassLoginInformation(scoped_refptr<LoginHandler> login_handler,
|
||||||
|
|
Загрузка…
Ссылка в новой задаче