fix tls and ech auto generate

This commit is contained in:
Alireza Ahmadi
2024-07-01 00:06:06 +02:00
parent 60b374e5d4
commit 209561497a
2 changed files with 10 additions and 4 deletions
+5 -3
View File
@@ -59,7 +59,6 @@
<v-textarea <v-textarea
:label="$t('tls.key')" :label="$t('tls.key')"
hide-details hide-details
rows="3"
v-model="echKeyText"> v-model="echKeyText">
</v-textarea> </v-textarea>
</v-col> </v-col>
@@ -69,7 +68,6 @@
<v-textarea <v-textarea
:label="$t('tls.cert')" :label="$t('tls.cert')"
hide-details hide-details
rows="3"
v-model="echConfigText"> v-model="echConfigText">
</v-textarea> </v-textarea>
</v-col> </v-col>
@@ -88,7 +86,7 @@ export default {
props: ['iTls','oTls'], props: ['iTls','oTls'],
data() { data() {
return { return {
useEchPath: 0, useEchPath: this.$props.iTls?.ech?.key? 1:0,
loading: false, loading: false,
} }
}, },
@@ -110,13 +108,17 @@ export default {
if (line === "-----BEGIN ECH CONFIGS-----") { if (line === "-----BEGIN ECH CONFIGS-----") {
isConfig = true isConfig = true
isKey = false isKey = false
config.push(line)
} else if (line === "-----END ECH CONFIGS-----") { } else if (line === "-----END ECH CONFIGS-----") {
isConfig = false isConfig = false
config.push(line)
} else if (line === "-----BEGIN ECH KEYS-----") { } else if (line === "-----BEGIN ECH KEYS-----") {
isKey = true isKey = true
isConfig = false isConfig = false
key.push(line)
} else if (line === "-----END ECH KEYS-----") { } else if (line === "-----END ECH KEYS-----") {
isKey = false isKey = false
key.push(line)
} else if (isConfig) { } else if (isConfig) {
config.push(line) config.push(line)
} else if (isKey) { } else if (isKey) {
+5 -1
View File
@@ -5,7 +5,7 @@
{{ $t('actions.' + title) + " " + $t('objects.tls') }} {{ $t('actions.' + title) + " " + $t('objects.tls') }}
</v-card-title> </v-card-title>
<v-divider></v-divider> <v-divider></v-divider>
<v-card-text> <v-card-text style="padding: 0 16px; overflow-y: scroll;">
<v-card class="rounded-lg"> <v-card class="rounded-lg">
<v-row> <v-row>
<v-col cols="12" sm="6" md="4"> <v-col cols="12" sm="6" md="4">
@@ -407,13 +407,17 @@ export default {
if (line === "-----BEGIN PRIVATE KEY-----") { if (line === "-----BEGIN PRIVATE KEY-----") {
isPrivateKey = true isPrivateKey = true
isPublicKey = false isPublicKey = false
privateKey.push(line)
} else if (line === "-----END PRIVATE KEY-----") { } else if (line === "-----END PRIVATE KEY-----") {
isPrivateKey = false isPrivateKey = false
privateKey.push(line)
} else if (line === "-----BEGIN CERTIFICATE-----") { } else if (line === "-----BEGIN CERTIFICATE-----") {
isPublicKey = true isPublicKey = true
isPrivateKey = false isPrivateKey = false
publicKey.push(line)
} else if (line === "-----END CERTIFICATE-----") { } else if (line === "-----END CERTIFICATE-----") {
isPublicKey = false isPublicKey = false
publicKey.push(line)
} else if (isPrivateKey) { } else if (isPrivateKey) {
privateKey.push(line) privateKey.push(line)
} else if (isPublicKey) { } else if (isPublicKey) {