From 209561497a2d30a05b8e1339f5732cf2bcc0145b Mon Sep 17 00:00:00 2001 From: Alireza Ahmadi Date: Mon, 1 Jul 2024 00:06:06 +0200 Subject: [PATCH] fix tls and ech auto generate --- frontend/src/components/tls/Ech.vue | 8 +++++--- frontend/src/layouts/modals/Tls.vue | 6 +++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/tls/Ech.vue b/frontend/src/components/tls/Ech.vue index 933e7ff..16255fa 100644 --- a/frontend/src/components/tls/Ech.vue +++ b/frontend/src/components/tls/Ech.vue @@ -59,7 +59,6 @@ @@ -69,7 +68,6 @@ @@ -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) { diff --git a/frontend/src/layouts/modals/Tls.vue b/frontend/src/layouts/modals/Tls.vue index 6aaa585..7b73406 100644 --- a/frontend/src/layouts/modals/Tls.vue +++ b/frontend/src/layouts/modals/Tls.vue @@ -5,7 +5,7 @@ {{ $t('actions.' + title) + " " + $t('objects.tls') }} - + @@ -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) {