populateTlsSettings method
void
populateTlsSettings({})
Implementation
void populateTlsSettings({
required String? streamSecurity,
required bool allowInsecure,
required String? sni,
required String? fingerprint,
required String? alpns,
required String? publicKey,
required String? shortId,
required String? spiderX,
}) {
streamSetting['security'] = streamSecurity;
Map<String, dynamic> tlsSetting = {
"allowInsecure": allowInsecure,
"serverName": sni,
"alpn": alpns == '' ? null : alpns?.split(','),
"minVersion": null,
"maxVersion": null,
"preferServerCipherSuites": null,
"cipherSuites": null,
"fingerprint": fingerprint,
"certificates": null,
"disableSystemRoot": null,
"enableSessionResumption": null,
"show": false,
"publicKey": publicKey,
"shortId": shortId,
"spiderX": spiderX,
};
if (streamSecurity == 'tls') {
streamSetting['realitySettings'] = null;
streamSetting['tlsSettings'] = tlsSetting;
} else if (streamSecurity == 'reality') {
streamSetting['tlsSettings'] = null;
streamSetting['realitySettings'] = tlsSetting;
}
}