fix utls default

This commit is contained in:
Nova 2025-12-08 14:59:17 +03:30 committed by parhelia512
parent 12d59a48d9
commit 61f747361e
4 changed files with 5 additions and 0 deletions

View File

@ -9,11 +9,13 @@ namespace Configs
class uTLS : public baseConfig
{
public:
bool supported = true;
bool enabled = false;
QString fingerPrint;
uTLS()
{
_add(new configItem("supported", &supported, boolean));
_add(new configItem("enabled", &enabled, itemType::boolean));
_add(new configItem("fingerprint", &fingerPrint, string));
}

View File

@ -28,6 +28,7 @@ namespace Configs
hysteria() : outbound()
{
tls->utls->supported = false;
_add(new configItem("protocol_version", &protocol_version, string));
_add(new configItem("server_ports", &server_ports, stringList));
_add(new configItem("hop_interval", &hop_interval, string));

View File

@ -22,6 +22,7 @@ namespace Configs
tuic() : outbound()
{
tls->utls->supported = false;
_add(new configItem("uuid", &uuid, string));
_add(new configItem("password", &password, string));
_add(new configItem("congestion_control", &congestion_control, string));

View File

@ -41,6 +41,7 @@ namespace Configs {
}
BuildResult uTLS::Build()
{
if (!supported) return {};
auto obj = ExportToJson();
if ((obj.isEmpty() || obj["enabled"].toBool() == false || fingerPrint.isEmpty()) && !dataStore->utlsFingerprint.isEmpty()) {
obj["enabled"] = true;