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
:label="$t('tls.key')"
hide-details
rows="3"
v-model="echKeyText">
</v-textarea>
</v-col>
@@ -69,7 +68,6 @@
<v-textarea
:label="$t('tls.cert')"
hide-details
rows="3"
v-model="echConfigText">
</v-textarea>
</v-col>
@@ -88,7 +86,7 @@ export default {
props: ['iTls','oTls'],
data() {
return {
useEchPath: 0,
useEchPath: this.$props.iTls?.ech?.key? 1:0,
loading: false,
}
},
@@ -110,13 +108,17 @@ export default {
if (line === "-----BEGIN ECH CONFIGS-----") {
isConfig = true
isKey = false
config.push(line)
} else if (line === "-----END ECH CONFIGS-----") {
isConfig = false
config.push(line)
} else if (line === "-----BEGIN ECH KEYS-----") {
isKey = true
isConfig = false
key.push(line)
} else if (line === "-----END ECH KEYS-----") {
isKey = false
key.push(line)
} else if (isConfig) {
config.push(line)
} else if (isKey) {
+5 -1
View File
@@ -5,7 +5,7 @@
{{ $t('actions.' + title) + " " + $t('objects.tls') }}
</v-card-title>
<v-divider></v-divider>
<v-card-text>
<v-card-text style="padding: 0 16px; overflow-y: scroll;">
<v-card class="rounded-lg">
<v-row>
<v-col cols="12" sm="6" md="4">
@@ -407,13 +407,17 @@ export default {
if (line === "-----BEGIN PRIVATE KEY-----") {
isPrivateKey = true
isPublicKey = false
privateKey.push(line)
} else if (line === "-----END PRIVATE KEY-----") {
isPrivateKey = false
privateKey.push(line)
} else if (line === "-----BEGIN CERTIFICATE-----") {
isPublicKey = true
isPrivateKey = false
publicKey.push(line)
} else if (line === "-----END CERTIFICATE-----") {
isPublicKey = false
publicKey.push(line)
} else if (isPrivateKey) {
privateKey.push(line)
} else if (isPublicKey) {