2019-08-14 05:15:34 +00:00
|
|
|
// Copyright (c) 2019 GitHub, Inc.
|
2015-10-31 13:39:07 +00:00
|
|
|
// Use of this source code is governed by the MIT license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2019-08-14 05:15:34 +00:00
|
|
|
#include "shell/common/gin_converters/net_converter.h"
|
2015-10-31 13:39:07 +00:00
|
|
|
|
2018-09-13 00:25:56 +00:00
|
|
|
#include <memory>
|
2018-09-19 11:10:26 +00:00
|
|
|
#include <string>
|
2018-09-13 00:25:56 +00:00
|
|
|
#include <utility>
|
2015-12-05 01:48:19 +00:00
|
|
|
#include <vector>
|
2015-11-05 14:06:36 +00:00
|
|
|
|
2016-07-19 03:06:17 +00:00
|
|
|
#include "base/strings/string_number_conversions.h"
|
2016-10-13 15:14:23 +00:00
|
|
|
#include "base/strings/string_util.h"
|
2016-08-26 22:30:02 +00:00
|
|
|
#include "base/values.h"
|
2019-08-24 01:14:23 +00:00
|
|
|
#include "gin/converter.h"
|
2019-08-14 05:15:34 +00:00
|
|
|
#include "gin/dictionary.h"
|
2015-11-05 14:06:36 +00:00
|
|
|
#include "net/cert/x509_certificate.h"
|
2018-04-12 19:55:43 +00:00
|
|
|
#include "net/cert/x509_util.h"
|
2015-12-01 04:52:22 +00:00
|
|
|
#include "net/http/http_response_headers.h"
|
2019-04-29 02:37:45 +00:00
|
|
|
#include "services/network/public/cpp/resource_request.h"
|
2019-09-03 22:54:14 +00:00
|
|
|
#include "shell/browser/api/atom_api_data_pipe_holder.h"
|
2019-08-14 05:15:34 +00:00
|
|
|
#include "shell/common/gin_converters/gurl_converter.h"
|
|
|
|
#include "shell/common/gin_converters/std_converter.h"
|
2019-10-31 07:56:00 +00:00
|
|
|
#include "shell/common/gin_converters/value_converter.h"
|
2019-06-19 20:46:59 +00:00
|
|
|
#include "shell/common/node_includes.h"
|
2015-10-31 13:39:07 +00:00
|
|
|
|
2019-08-14 05:15:34 +00:00
|
|
|
namespace gin {
|
2015-10-31 13:39:07 +00:00
|
|
|
|
2017-04-04 13:19:23 +00:00
|
|
|
namespace {
|
|
|
|
|
|
|
|
bool CertFromData(const std::string& data,
|
2018-04-18 01:55:30 +00:00
|
|
|
scoped_refptr<net::X509Certificate>* out) {
|
2017-04-04 13:19:23 +00:00
|
|
|
auto cert_list = net::X509Certificate::CreateCertificateListFromBytes(
|
2018-04-18 01:55:30 +00:00
|
|
|
data.c_str(), data.length(),
|
|
|
|
net::X509Certificate::FORMAT_SINGLE_CERTIFICATE);
|
2017-04-04 13:19:23 +00:00
|
|
|
if (cert_list.empty())
|
|
|
|
return false;
|
|
|
|
|
|
|
|
auto leaf_cert = cert_list.front();
|
|
|
|
if (!leaf_cert)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
*out = leaf_cert;
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2017-04-04 13:23:30 +00:00
|
|
|
} // namespace
|
2017-04-04 13:19:23 +00:00
|
|
|
|
2015-10-31 13:39:07 +00:00
|
|
|
// static
|
2019-04-20 17:20:37 +00:00
|
|
|
v8::Local<v8::Value> Converter<net::AuthChallengeInfo>::ToV8(
|
2018-04-18 01:55:30 +00:00
|
|
|
v8::Isolate* isolate,
|
2019-04-20 17:20:37 +00:00
|
|
|
const net::AuthChallengeInfo& val) {
|
2019-08-14 05:15:34 +00:00
|
|
|
gin::Dictionary dict = gin::Dictionary::CreateEmpty(isolate);
|
2019-04-20 17:20:37 +00:00
|
|
|
dict.Set("isProxy", val.is_proxy);
|
|
|
|
dict.Set("scheme", val.scheme);
|
|
|
|
dict.Set("host", val.challenger.host());
|
|
|
|
dict.Set("port", static_cast<uint32_t>(val.challenger.port()));
|
|
|
|
dict.Set("realm", val.realm);
|
2019-08-14 05:15:34 +00:00
|
|
|
return gin::ConvertToV8(isolate, dict);
|
2015-10-31 13:39:07 +00:00
|
|
|
}
|
|
|
|
|
2015-11-05 14:06:36 +00:00
|
|
|
// static
|
|
|
|
v8::Local<v8::Value> Converter<scoped_refptr<net::X509Certificate>>::ToV8(
|
2018-04-18 01:55:30 +00:00
|
|
|
v8::Isolate* isolate,
|
|
|
|
const scoped_refptr<net::X509Certificate>& val) {
|
2019-08-14 05:15:34 +00:00
|
|
|
gin::Dictionary dict(isolate, v8::Object::New(isolate));
|
2015-11-05 14:06:36 +00:00
|
|
|
std::string encoded_data;
|
2018-04-12 19:55:43 +00:00
|
|
|
net::X509Certificate::GetPEMEncoded(val->cert_buffer(), &encoded_data);
|
2016-11-06 13:37:07 +00:00
|
|
|
|
2016-08-10 21:47:05 +00:00
|
|
|
dict.Set("data", encoded_data);
|
2016-11-12 12:18:38 +00:00
|
|
|
dict.Set("issuer", val->issuer());
|
2015-11-05 14:06:36 +00:00
|
|
|
dict.Set("issuerName", val->issuer().GetDisplayName());
|
2016-11-12 12:18:38 +00:00
|
|
|
dict.Set("subject", val->subject());
|
2016-07-12 17:05:28 +00:00
|
|
|
dict.Set("subjectName", val->subject().GetDisplayName());
|
2016-07-19 03:06:17 +00:00
|
|
|
dict.Set("serialNumber", base::HexEncode(val->serial_number().data(),
|
|
|
|
val->serial_number().size()));
|
2016-07-12 17:05:28 +00:00
|
|
|
dict.Set("validStart", val->valid_start().ToDoubleT());
|
|
|
|
dict.Set("validExpiry", val->valid_expiry().ToDoubleT());
|
2016-07-14 11:09:11 +00:00
|
|
|
dict.Set("fingerprint",
|
2018-04-12 19:55:43 +00:00
|
|
|
net::HashValue(val->CalculateFingerprint256(val->cert_buffer()))
|
2018-04-18 01:55:30 +00:00
|
|
|
.ToString());
|
2016-07-12 17:05:28 +00:00
|
|
|
|
2018-04-12 19:55:43 +00:00
|
|
|
const auto& intermediate_buffers = val->intermediate_buffers();
|
|
|
|
if (!intermediate_buffers.empty()) {
|
|
|
|
std::vector<bssl::UniquePtr<CRYPTO_BUFFER>> issuer_intermediates;
|
|
|
|
issuer_intermediates.reserve(intermediate_buffers.size() - 1);
|
|
|
|
for (size_t i = 1; i < intermediate_buffers.size(); ++i) {
|
|
|
|
issuer_intermediates.push_back(
|
2018-10-02 18:11:45 +00:00
|
|
|
bssl::UpRef(intermediate_buffers[i].get()));
|
2018-04-12 19:55:43 +00:00
|
|
|
}
|
2016-11-09 17:19:35 +00:00
|
|
|
const scoped_refptr<net::X509Certificate>& issuer_cert =
|
2018-04-12 19:55:43 +00:00
|
|
|
net::X509Certificate::CreateFromBuffer(
|
2018-10-02 18:11:45 +00:00
|
|
|
bssl::UpRef(intermediate_buffers[0].get()),
|
2018-04-12 19:55:43 +00:00
|
|
|
std::move(issuer_intermediates));
|
2016-11-12 12:18:38 +00:00
|
|
|
dict.Set("issuerCert", issuer_cert);
|
2016-11-09 17:19:35 +00:00
|
|
|
}
|
|
|
|
|
2019-08-14 05:15:34 +00:00
|
|
|
return ConvertToV8(isolate, dict);
|
2016-11-09 17:19:35 +00:00
|
|
|
}
|
|
|
|
|
2017-03-31 18:16:26 +00:00
|
|
|
bool Converter<scoped_refptr<net::X509Certificate>>::FromV8(
|
2018-04-18 01:55:30 +00:00
|
|
|
v8::Isolate* isolate,
|
|
|
|
v8::Local<v8::Value> val,
|
2017-03-31 18:16:26 +00:00
|
|
|
scoped_refptr<net::X509Certificate>* out) {
|
2019-08-14 05:15:34 +00:00
|
|
|
gin::Dictionary dict(nullptr);
|
2017-03-31 18:16:26 +00:00
|
|
|
if (!ConvertFromV8(isolate, val, &dict))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
std::string data;
|
|
|
|
dict.Get("data", &data);
|
2017-04-01 01:27:49 +00:00
|
|
|
scoped_refptr<net::X509Certificate> leaf_cert;
|
|
|
|
if (!CertFromData(data, &leaf_cert))
|
2017-03-31 19:44:47 +00:00
|
|
|
return false;
|
|
|
|
|
2018-04-12 19:55:43 +00:00
|
|
|
scoped_refptr<net::X509Certificate> issuer_cert;
|
|
|
|
if (dict.Get("issuerCert", &issuer_cert)) {
|
|
|
|
std::vector<bssl::UniquePtr<CRYPTO_BUFFER>> intermediates;
|
2018-10-02 18:11:45 +00:00
|
|
|
intermediates.push_back(bssl::UpRef(issuer_cert->cert_buffer()));
|
2018-04-12 19:55:43 +00:00
|
|
|
auto cert = net::X509Certificate::CreateFromBuffer(
|
2018-10-02 18:11:45 +00:00
|
|
|
bssl::UpRef(leaf_cert->cert_buffer()), std::move(intermediates));
|
2017-04-03 20:27:53 +00:00
|
|
|
if (!cert)
|
2017-04-01 01:27:49 +00:00
|
|
|
return false;
|
|
|
|
|
2017-04-03 20:27:53 +00:00
|
|
|
*out = cert;
|
|
|
|
} else {
|
|
|
|
*out = leaf_cert;
|
2017-04-01 01:27:49 +00:00
|
|
|
}
|
|
|
|
|
2017-03-31 17:53:31 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2016-11-09 17:19:35 +00:00
|
|
|
// static
|
|
|
|
v8::Local<v8::Value> Converter<net::CertPrincipal>::ToV8(
|
2018-04-18 01:55:30 +00:00
|
|
|
v8::Isolate* isolate,
|
|
|
|
const net::CertPrincipal& val) {
|
2019-08-14 05:15:34 +00:00
|
|
|
gin::Dictionary dict(isolate, v8::Object::New(isolate));
|
2016-11-09 17:19:35 +00:00
|
|
|
|
|
|
|
dict.Set("commonName", val.common_name);
|
2016-11-12 12:18:38 +00:00
|
|
|
dict.Set("organizations", val.organization_names);
|
|
|
|
dict.Set("organizationUnits", val.organization_unit_names);
|
2016-11-09 17:19:35 +00:00
|
|
|
dict.Set("locality", val.locality_name);
|
|
|
|
dict.Set("state", val.state_or_province_name);
|
|
|
|
dict.Set("country", val.country_name);
|
|
|
|
|
2019-08-14 05:15:34 +00:00
|
|
|
return ConvertToV8(isolate, dict);
|
2015-11-05 14:06:36 +00:00
|
|
|
}
|
|
|
|
|
2016-10-13 15:14:23 +00:00
|
|
|
// static
|
2016-10-25 10:41:01 +00:00
|
|
|
v8::Local<v8::Value> Converter<net::HttpResponseHeaders*>::ToV8(
|
2016-10-13 15:14:23 +00:00
|
|
|
v8::Isolate* isolate,
|
2016-10-25 10:41:01 +00:00
|
|
|
net::HttpResponseHeaders* headers) {
|
2016-10-13 15:14:23 +00:00
|
|
|
base::DictionaryValue response_headers;
|
|
|
|
if (headers) {
|
|
|
|
size_t iter = 0;
|
|
|
|
std::string key;
|
|
|
|
std::string value;
|
|
|
|
while (headers->EnumerateHeaderLines(&iter, &key, &value)) {
|
|
|
|
key = base::ToLowerASCII(key);
|
2019-08-21 02:14:21 +00:00
|
|
|
base::Value* values = response_headers.FindListKey(key);
|
|
|
|
if (!values)
|
|
|
|
values = response_headers.SetKey(key, base::ListValue());
|
|
|
|
values->GetList().emplace_back(value);
|
2016-10-13 15:14:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return ConvertToV8(isolate, response_headers);
|
|
|
|
}
|
|
|
|
|
2017-11-03 17:46:49 +00:00
|
|
|
bool Converter<net::HttpResponseHeaders*>::FromV8(
|
|
|
|
v8::Isolate* isolate,
|
|
|
|
v8::Local<v8::Value> val,
|
|
|
|
net::HttpResponseHeaders* out) {
|
|
|
|
if (!val->IsObject()) {
|
|
|
|
return false;
|
|
|
|
}
|
2018-10-25 00:34:20 +00:00
|
|
|
|
|
|
|
auto addHeaderFromValue = [&isolate, &out](
|
|
|
|
const std::string& key,
|
|
|
|
const v8::Local<v8::Value>& localVal) {
|
|
|
|
auto context = isolate->GetCurrentContext();
|
|
|
|
v8::Local<v8::String> localStrVal;
|
|
|
|
if (!localVal->ToString(context).ToLocal(&localStrVal)) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
std::string value;
|
2019-08-14 05:15:34 +00:00
|
|
|
gin::ConvertFromV8(isolate, localStrVal, &value);
|
2018-10-25 00:34:20 +00:00
|
|
|
out->AddHeader(key + ": " + value);
|
|
|
|
return true;
|
|
|
|
};
|
|
|
|
|
2017-11-03 17:46:49 +00:00
|
|
|
auto context = isolate->GetCurrentContext();
|
|
|
|
auto headers = v8::Local<v8::Object>::Cast(val);
|
2019-01-21 16:27:11 +00:00
|
|
|
auto keys = headers->GetOwnPropertyNames(context).ToLocalChecked();
|
2017-11-03 17:46:49 +00:00
|
|
|
for (uint32_t i = 0; i < keys->Length(); i++) {
|
2019-01-21 16:27:11 +00:00
|
|
|
v8::Local<v8::Value> keyVal;
|
|
|
|
if (!keys->Get(context, i).ToLocal(&keyVal)) {
|
2017-11-03 17:46:49 +00:00
|
|
|
return false;
|
|
|
|
}
|
2018-10-25 00:34:20 +00:00
|
|
|
std::string key;
|
2019-08-14 05:15:34 +00:00
|
|
|
gin::ConvertFromV8(isolate, keyVal, &key);
|
2018-10-25 00:34:20 +00:00
|
|
|
|
2019-01-21 16:27:11 +00:00
|
|
|
auto localVal = headers->Get(context, keyVal).ToLocalChecked();
|
2018-10-25 00:34:20 +00:00
|
|
|
if (localVal->IsArray()) {
|
|
|
|
auto values = v8::Local<v8::Array>::Cast(localVal);
|
|
|
|
for (uint32_t j = 0; j < values->Length(); j++) {
|
2019-05-01 00:18:22 +00:00
|
|
|
if (!addHeaderFromValue(key,
|
|
|
|
values->Get(context, j).ToLocalChecked())) {
|
2018-10-25 00:34:20 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (!addHeaderFromValue(key, localVal)) {
|
|
|
|
return false;
|
|
|
|
}
|
2017-11-03 17:46:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2019-08-16 01:19:05 +00:00
|
|
|
// static
|
|
|
|
v8::Local<v8::Value> Converter<net::HttpRequestHeaders>::ToV8(
|
|
|
|
v8::Isolate* isolate,
|
|
|
|
const net::HttpRequestHeaders& val) {
|
|
|
|
gin::Dictionary headers(isolate, v8::Object::New(isolate));
|
|
|
|
for (net::HttpRequestHeaders::Iterator it(val); it.GetNext();)
|
|
|
|
headers.Set(it.name(), it.value());
|
|
|
|
return ConvertToV8(isolate, headers);
|
|
|
|
}
|
|
|
|
|
|
|
|
// static
|
|
|
|
bool Converter<net::HttpRequestHeaders>::FromV8(v8::Isolate* isolate,
|
|
|
|
v8::Local<v8::Value> val,
|
|
|
|
net::HttpRequestHeaders* out) {
|
|
|
|
base::DictionaryValue dict;
|
|
|
|
if (!ConvertFromV8(isolate, val, &dict))
|
|
|
|
return false;
|
|
|
|
for (base::DictionaryValue::Iterator it(dict); !it.IsAtEnd(); it.Advance()) {
|
|
|
|
if (it.value().is_string()) {
|
|
|
|
std::string value = it.value().GetString();
|
|
|
|
out->SetHeader(it.key(), value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2019-08-21 02:14:21 +00:00
|
|
|
// static
|
|
|
|
v8::Local<v8::Value> Converter<network::ResourceRequestBody>::ToV8(
|
|
|
|
v8::Isolate* isolate,
|
|
|
|
const network::ResourceRequestBody& val) {
|
|
|
|
const auto& elements = *val.elements();
|
|
|
|
v8::Local<v8::Array> arr = v8::Array::New(isolate, elements.size());
|
|
|
|
for (size_t i = 0; i < elements.size(); ++i) {
|
|
|
|
const auto& element = elements[i];
|
|
|
|
gin::Dictionary upload_data(isolate, v8::Object::New(isolate));
|
|
|
|
switch (element.type()) {
|
|
|
|
case network::mojom::DataElementType::kFile:
|
|
|
|
upload_data.Set("file", element.path().value());
|
|
|
|
break;
|
|
|
|
case network::mojom::DataElementType::kBytes:
|
|
|
|
upload_data.Set("bytes", node::Buffer::Copy(isolate, element.bytes(),
|
|
|
|
element.length())
|
|
|
|
.ToLocalChecked());
|
|
|
|
break;
|
2019-09-03 22:54:14 +00:00
|
|
|
case network::mojom::DataElementType::kDataPipe: {
|
|
|
|
// TODO(zcbenz): After the NetworkService refactor, the old blobUUID API
|
|
|
|
// becomes unecessarily complex, we should deprecate the getBlobData API
|
|
|
|
// and return the DataPipeHolder wrapper directly.
|
|
|
|
auto holder = electron::api::DataPipeHolder::Create(isolate, element);
|
|
|
|
upload_data.Set("blobUUID", holder->id());
|
|
|
|
// The lifetime of data pipe is bound to the uploadData object.
|
|
|
|
upload_data.Set("dataPipe", holder);
|
2019-08-21 02:14:21 +00:00
|
|
|
break;
|
2019-09-03 22:54:14 +00:00
|
|
|
}
|
2019-08-21 02:14:21 +00:00
|
|
|
default:
|
|
|
|
NOTREACHED() << "Found unsupported data element";
|
|
|
|
}
|
|
|
|
arr->Set(isolate->GetCurrentContext(), static_cast<uint32_t>(i),
|
|
|
|
ConvertToV8(isolate, upload_data))
|
|
|
|
.Check();
|
|
|
|
}
|
|
|
|
return arr;
|
|
|
|
}
|
|
|
|
|
2019-10-25 13:03:28 +00:00
|
|
|
// static
|
|
|
|
v8::Local<v8::Value>
|
|
|
|
Converter<scoped_refptr<network::ResourceRequestBody>>::ToV8(
|
|
|
|
v8::Isolate* isolate,
|
|
|
|
const scoped_refptr<network::ResourceRequestBody>& val) {
|
|
|
|
if (!val)
|
|
|
|
return v8::Null(isolate);
|
|
|
|
return ConvertToV8(isolate, *val);
|
|
|
|
}
|
|
|
|
|
|
|
|
// static
|
|
|
|
bool Converter<scoped_refptr<network::ResourceRequestBody>>::FromV8(
|
|
|
|
v8::Isolate* isolate,
|
|
|
|
v8::Local<v8::Value> val,
|
|
|
|
scoped_refptr<network::ResourceRequestBody>* out) {
|
|
|
|
auto list = std::make_unique<base::ListValue>();
|
|
|
|
if (!ConvertFromV8(isolate, val, list.get()))
|
|
|
|
return false;
|
|
|
|
*out = new network::ResourceRequestBody();
|
|
|
|
for (size_t i = 0; i < list->GetSize(); ++i) {
|
|
|
|
base::DictionaryValue* dict = nullptr;
|
|
|
|
std::string type;
|
|
|
|
if (!list->GetDictionary(i, &dict))
|
|
|
|
return false;
|
|
|
|
dict->GetString("type", &type);
|
|
|
|
if (type == "rawData") {
|
|
|
|
base::Value* bytes = nullptr;
|
|
|
|
dict->GetBinary("bytes", &bytes);
|
|
|
|
(*out)->AppendBytes(
|
|
|
|
reinterpret_cast<const char*>(bytes->GetBlob().data()),
|
|
|
|
base::checked_cast<int>(bytes->GetBlob().size()));
|
|
|
|
} else if (type == "file") {
|
|
|
|
std::string file;
|
|
|
|
int offset = 0, length = -1;
|
|
|
|
double modification_time = 0.0;
|
|
|
|
dict->GetStringWithoutPathExpansion("filePath", &file);
|
|
|
|
dict->GetInteger("offset", &offset);
|
|
|
|
dict->GetInteger("file", &length);
|
|
|
|
dict->GetDouble("modificationTime", &modification_time);
|
|
|
|
(*out)->AppendFileRange(base::FilePath::FromUTF8Unsafe(file),
|
|
|
|
static_cast<uint64_t>(offset),
|
|
|
|
static_cast<uint64_t>(length),
|
|
|
|
base::Time::FromDoubleT(modification_time));
|
|
|
|
} else if (type == "blob") {
|
|
|
|
std::string uuid;
|
|
|
|
dict->GetString("blobUUID", &uuid);
|
|
|
|
(*out)->AppendBlob(uuid);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2019-04-29 02:37:45 +00:00
|
|
|
// static
|
|
|
|
v8::Local<v8::Value> Converter<network::ResourceRequest>::ToV8(
|
|
|
|
v8::Isolate* isolate,
|
|
|
|
const network::ResourceRequest& val) {
|
2019-08-14 05:15:34 +00:00
|
|
|
gin::Dictionary dict(isolate, v8::Object::New(isolate));
|
2019-04-29 02:37:45 +00:00
|
|
|
dict.Set("method", val.method);
|
|
|
|
dict.Set("url", val.url.spec());
|
|
|
|
dict.Set("referrer", val.referrer.spec());
|
2019-08-16 01:19:05 +00:00
|
|
|
dict.Set("headers", val.headers);
|
2019-08-21 02:14:21 +00:00
|
|
|
if (val.request_body)
|
|
|
|
dict.Set("uploadData", ConvertToV8(isolate, *val.request_body));
|
2019-08-14 05:15:34 +00:00
|
|
|
return ConvertToV8(isolate, dict);
|
2019-04-29 02:37:45 +00:00
|
|
|
}
|
|
|
|
|
2019-08-07 15:04:09 +00:00
|
|
|
// static
|
|
|
|
v8::Local<v8::Value> Converter<electron::VerifyRequestParams>::ToV8(
|
|
|
|
v8::Isolate* isolate,
|
|
|
|
electron::VerifyRequestParams val) {
|
2019-08-14 05:15:34 +00:00
|
|
|
gin::Dictionary dict = gin::Dictionary::CreateEmpty(isolate);
|
2019-08-07 15:04:09 +00:00
|
|
|
dict.Set("hostname", val.hostname);
|
|
|
|
dict.Set("certificate", val.certificate);
|
|
|
|
dict.Set("verificationResult", val.default_result);
|
|
|
|
dict.Set("errorCode", val.error_code);
|
2019-08-14 05:15:34 +00:00
|
|
|
return ConvertToV8(isolate, dict);
|
2019-08-07 15:04:09 +00:00
|
|
|
}
|
|
|
|
|
2019-08-14 05:15:34 +00:00
|
|
|
} // namespace gin
|