feat: add disabledCipherSuites option to setSSLConfig (#25818)
This commit is contained in:
parent
f6a27973d1
commit
22cb3cd18b
3 changed files with 85 additions and 4 deletions
|
@ -202,6 +202,19 @@ bool SSLProtocolVersionFromString(const std::string& version_str,
|
|||
return false;
|
||||
}
|
||||
|
||||
template <>
|
||||
struct Converter<uint16_t> {
|
||||
static bool FromV8(v8::Isolate* isolate,
|
||||
v8::Local<v8::Value> val,
|
||||
uint16_t* out) {
|
||||
auto maybe = val->IntegerValue(isolate->GetCurrentContext());
|
||||
if (maybe.IsNothing())
|
||||
return false;
|
||||
*out = maybe.FromJust();
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct Converter<network::mojom::SSLConfigPtr> {
|
||||
static bool FromV8(v8::Isolate* isolate,
|
||||
|
@ -224,8 +237,14 @@ struct Converter<network::mojom::SSLConfigPtr> {
|
|||
return false;
|
||||
}
|
||||
|
||||
// TODO(nornagon): also support client_cert_pooling_policy and
|
||||
// disabled_cipher_suites. Maybe other SSLConfig properties too?
|
||||
if (options.Has("disabledCipherSuites") &&
|
||||
!options.Get("disabledCipherSuites", &(*out)->disabled_cipher_suites)) {
|
||||
return false;
|
||||
}
|
||||
std::sort((*out)->disabled_cipher_suites.begin(),
|
||||
(*out)->disabled_cipher_suites.end());
|
||||
|
||||
// TODO(nornagon): also support other SSLConfig properties?
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue