Added encodeURIComponent to CSR certificate
Description 1:
Downloading the CSR certificate data value without
encodeURIComponent function is not supported in Firefox
So added the encodeURIComponent function to download the
csr certificate
Tested:
Step 1: Launch WEBUI on firefox
Step 2: Navigate to Security and access, Certificates Page
Step 3: Generate and Download CSR certificate
(KeyPair Algorithm - EC and Key curve id - secp521r1)
Step 4: After CSR Downloaded, copy the downloaded
file to any of the linux machine
Step 5: Try to create an https/ldap certificate
via openssl on linux machine
Result:
Able to download the CSR certificate successfully
and able to create https/ldap certificate via openssl
Description 2:
While downloading the generated csr via Web UI,
the csr file is getting downloaded as ".txt" file
but it should download as ".csr" file
So changed the extension to ".csr"
Tested:
Step 1: Login to Web UI.
Step 2: Navigate to Security and access, Certificates Page
Step 3: Click Generate CSR Button and fill the required details
Step 4: Click Generate CSR from the popup modal.
Step 5: After CSR Generated an prompt will open
and it will show download and copy option. In that select download,
the csr certificate will download with ".csr" extension
Change-Id: Ice176006a95afd53845d7696ce0eac88f02b1096
Signed-off-by: Sivaprabu Ganesan <sivaprabug@ami.com>
diff --git a/src/views/SecurityAndAccess/Certificates/ModalGenerateCsr.vue b/src/views/SecurityAndAccess/Certificates/ModalGenerateCsr.vue
index d76f9fe..6f6fa86 100644
--- a/src/views/SecurityAndAccess/Certificates/ModalGenerateCsr.vue
+++ b/src/views/SecurityAndAccess/Certificates/ModalGenerateCsr.vue
@@ -361,8 +361,11 @@
</template>
</b-btn>
<a
- :href="`data:text/json;charset=utf-8,${csrString}`"
- download="certificate.txt"
+ :href="
+ `data:application/json;charset=utf-8,` +
+ encodeURIComponent(`${csrString}`)
+ "
+ download="certificate.csr"
class="btn btn-primary"
>
{{ $t('global.action.download') }}