mirror of
https://github.com/MatsuriDayo/nekoray.git
synced 2025-12-17 12:34:37 +03:00
update v2ray-core v5.2.0
add utls gui for nekoray
This commit is contained in:
@@ -47,6 +47,7 @@ namespace NekoRay::fmt {
|
||||
}
|
||||
|
||||
if (security == "tls") {
|
||||
bool v5_utls = !utlsFingerprint.isEmpty();
|
||||
QJsonObject tls;
|
||||
if (allow_insecure || dataStore->skip_cert) tls["allowInsecure"] = true;
|
||||
if (!sni.trimmed().isEmpty()) tls["serverName"] = sni;
|
||||
@@ -54,16 +55,24 @@ namespace NekoRay::fmt {
|
||||
tls["disableSystemRoot"] = true;
|
||||
tls["certificates"] = QJsonArray{
|
||||
QJsonObject{
|
||||
{"usage", "verify"},
|
||||
{"usage", v5_utls ? "ENCIPHERMENT" : "verify"},
|
||||
{"certificate", QList2QJsonArray(SplitLines(certificate.trimmed()))},
|
||||
},
|
||||
};
|
||||
}
|
||||
if (!alpn.trimmed().isEmpty()) {
|
||||
tls["alpn"] = QList2QJsonArray(alpn.split(","));
|
||||
tls[v5_utls ? "nextProtocol" : "alpn"] = QList2QJsonArray(alpn.split(","));
|
||||
}
|
||||
if (v5_utls) {
|
||||
streamSettings["utlsSettings"] = QJsonObject{
|
||||
{"imitate", utlsFingerprint},
|
||||
{"tlsConfig", tls},
|
||||
};
|
||||
streamSettings["security"] = "utls";
|
||||
} else {
|
||||
streamSettings["tlsSettings"] = tls;
|
||||
streamSettings["security"] = "tls";
|
||||
}
|
||||
streamSettings["tlsSettings"] = tls;
|
||||
streamSettings["security"] = "tls";
|
||||
}
|
||||
|
||||
return streamSettings;
|
||||
|
||||
Reference in New Issue
Block a user