corrections

This commit is contained in:
Alireza Ahmadi
2026-02-02 16:22:21 +01:00
parent adead1cc39
commit 57d437dff8
5 changed files with 18 additions and 19 deletions

View File

@@ -596,7 +596,6 @@ class TlsStreamSettings extends XrayCommonClass {
maxVersion = TLS_VERSION_OPTION.TLS13, maxVersion = TLS_VERSION_OPTION.TLS13,
cipherSuites = '', cipherSuites = '',
rejectUnknownSni = false, rejectUnknownSni = false,
pinnedPeerCertSha256 = [],
disableSystemRoot = false, disableSystemRoot = false,
enableSessionResumption = false, enableSessionResumption = false,
certificates = [new TlsStreamSettings.Cert()], certificates = [new TlsStreamSettings.Cert()],
@@ -611,7 +610,6 @@ class TlsStreamSettings extends XrayCommonClass {
this.maxVersion = maxVersion; this.maxVersion = maxVersion;
this.cipherSuites = cipherSuites; this.cipherSuites = cipherSuites;
this.rejectUnknownSni = rejectUnknownSni; this.rejectUnknownSni = rejectUnknownSni;
this.pinnedPeerCertSha256 = pinnedPeerCertSha256;
this.disableSystemRoot = disableSystemRoot; this.disableSystemRoot = disableSystemRoot;
this.enableSessionResumption = enableSessionResumption; this.enableSessionResumption = enableSessionResumption;
this.certs = certificates; this.certs = certificates;
@@ -645,7 +643,6 @@ class TlsStreamSettings extends XrayCommonClass {
json.maxVersion, json.maxVersion,
json.cipherSuites, json.cipherSuites,
json.rejectUnknownSni, json.rejectUnknownSni,
json.pinnedPeerCertSha256 || [],
json.disableSystemRoot, json.disableSystemRoot,
json.enableSessionResumption, json.enableSessionResumption,
certs, certs,
@@ -663,7 +660,6 @@ class TlsStreamSettings extends XrayCommonClass {
maxVersion: this.maxVersion, maxVersion: this.maxVersion,
cipherSuites: this.cipherSuites, cipherSuites: this.cipherSuites,
rejectUnknownSni: this.rejectUnknownSni, rejectUnknownSni: this.rejectUnknownSni,
pinnedPeerCertSha256: this.pinnedPeerCertSha256.length > 0 ? this.pinnedPeerCertSha256 : undefined,
disableSystemRoot: this.disableSystemRoot, disableSystemRoot: this.disableSystemRoot,
enableSessionResumption: this.enableSessionResumption, enableSessionResumption: this.enableSessionResumption,
certificates: TlsStreamSettings.toJsonArray(this.certs), certificates: TlsStreamSettings.toJsonArray(this.certs),

View File

@@ -345,7 +345,8 @@ class TlsStreamSettings extends CommonClass {
fingerprint = '', fingerprint = '',
allowInsecure = false, allowInsecure = false,
echConfigList = '', echConfigList = '',
verifyPeerCertByName = [] verifyPeerCertByName = 'cloudflare-dns.com',
pinnedPeerCertSha256 = '',
) { ) {
super(); super();
this.serverName = serverName; this.serverName = serverName;
@@ -353,7 +354,8 @@ class TlsStreamSettings extends CommonClass {
this.fingerprint = fingerprint; this.fingerprint = fingerprint;
this.allowInsecure = allowInsecure; this.allowInsecure = allowInsecure;
this.echConfigList = echConfigList; this.echConfigList = echConfigList;
this.verifyPeerCertByName = Array.isArray(verifyPeerCertByName) ? verifyPeerCertByName.join(",") : verifyPeerCertByName; this.verifyPeerCertByName = verifyPeerCertByName;
this.pinnedPeerCertSha256 = pinnedPeerCertSha256;
} }
static fromJson(json = {}) { static fromJson(json = {}) {
@@ -363,7 +365,8 @@ class TlsStreamSettings extends CommonClass {
json.fingerprint, json.fingerprint,
json.allowInsecure, json.allowInsecure,
json.echConfigList, json.echConfigList,
json.verifyPeerCertByName json.verifyPeerCertByName,
json.pinnedPeerCertSha256,
); );
} }
@@ -374,7 +377,8 @@ class TlsStreamSettings extends CommonClass {
fingerprint: this.fingerprint, fingerprint: this.fingerprint,
allowInsecure: this.allowInsecure, allowInsecure: this.allowInsecure,
echConfigList: this.echConfigList, echConfigList: this.echConfigList,
verifyPeerCertByName: this.verifyPeerCertByName.length > 0 ? this.verifyPeerCertByName.split(",") : undefined, verifyPeerCertByName: this.verifyPeerCertByName,
pinnedPeerCertSha256: this.pinnedPeerCertSha256
}; };
} }
} }

View File

@@ -586,8 +586,13 @@
<a-form-item label="Allow Insecure"> <a-form-item label="Allow Insecure">
<a-switch v-model="outbound.stream.tls.allowInsecure"></a-switch> <a-switch v-model="outbound.stream.tls.allowInsecure"></a-switch>
</a-form-item> </a-form-item>
<a-form-item label="VerifyPeerCertByNames"> <a-form-item label="Verify Peer Cert By Name">
<a-input v-model.trim="outbound.stream.tls.verifyPeerCertByNames"></a-input> <a-input v-model.trim="outbound.stream.tls.verifyPeerCertByName"></a-input>
</a-form-item>
<a-form-item label="Pinned Peer Cert">
<a-input v-model.trim="outbound.stream.tls.pinnedPeerCertSha256"
placeholder="Enter SHA256 fingerprints (base64)">
</a-input>
</a-form-item> </a-form-item>
</template> </template>

View File

@@ -58,12 +58,6 @@
<a-form-item label="Session Resumption"> <a-form-item label="Session Resumption">
<a-switch v-model="inbound.stream.tls.enableSessionResumption"></a-switch> <a-switch v-model="inbound.stream.tls.enableSessionResumption"></a-switch>
</a-form-item> </a-form-item>
<a-form-item label="Pinned Peer Cert">
<a-select mode="tags" v-model="inbound.stream.tls.pinnedPeerCertSha256"
:dropdown-class-name="themeSwitcher.currentTheme"
placeholder="Enter SHA256 fingerprints (base64)">
</a-select>
</a-form-item>
<a-divider :style="{ margin: '0' }"></a-divider> <a-divider :style="{ margin: '0' }"></a-divider>
<template v-for="cert,index in inbound.stream.tls.certs"> <template v-for="cert,index in inbound.stream.tls.certs">
<a-form-item label='{{ i18n "certificate" }}'> <a-form-item label='{{ i18n "certificate" }}'>

View File

@@ -48,10 +48,10 @@ func InitLocalizer(i18nFS embed.FS, settingService SettingService) error {
return nil return nil
} }
func createTemplateData(params []string, seperator ...string) map[string]interface{} { func createTemplateData(params []string, separator ...string) map[string]interface{} {
var sep string = "==" var sep string = "=="
if len(seperator) > 0 { if len(separator) > 0 {
sep = seperator[0] sep = separator[0]
} }
templateData := make(map[string]interface{}) templateData := make(map[string]interface{})