Slightly better conversion
This commit is contained in:
parent
141a5ad73f
commit
302ca8669d
1 changed files with 12 additions and 1 deletions
|
@ -82,7 +82,18 @@ bool Converter<scoped_refptr<net::X509Certificate>>::FromV8(
|
|||
|
||||
std::string data;
|
||||
dict.Get("data", &data);
|
||||
*out = net::X509Certificate::CreateFromBytes(data.c_str(), data.length());
|
||||
|
||||
auto certificate_list = net::X509Certificate::CreateCertificateListFromBytes(
|
||||
data.c_str(), data.length(),
|
||||
net::X509Certificate::FORMAT_SINGLE_CERTIFICATE);
|
||||
if (certificate_list.empty())
|
||||
return false;
|
||||
|
||||
auto certificate = certificate_list.front();
|
||||
if (!certificate)
|
||||
return false;
|
||||
|
||||
*out = certificate;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue