From 93847bd309c5556ae05a961c41944594eeb03cea Mon Sep 17 00:00:00 2001 From: Ildar Kamalov Date: Fri, 1 Feb 2019 13:57:39 +0300 Subject: [PATCH] Convert certificate and key to base64 --- client/src/actions/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/src/actions/index.js b/client/src/actions/index.js index be4e4d7e..be3a8c65 100644 --- a/client/src/actions/index.js +++ b/client/src/actions/index.js @@ -659,8 +659,8 @@ export const getTlsStatus = () => async (dispatch) => { dispatch(getTlsStatusRequest()); try { const status = await apiClient.getTlsStatus(); - status.certificate_chain = decodeURIComponent(status.certificate_chain); - status.private_key = decodeURIComponent(status.private_key); + status.certificate_chain = atob(status.certificate_chain); + status.private_key = atob(status.private_key); dispatch(getTlsStatusSuccess(status)); } catch (error) { @@ -677,8 +677,8 @@ export const setTlsConfig = config => async (dispatch) => { dispatch(setTlsConfigRequest()); try { const values = { ...config }; - values.certificate_chain = encodeURIComponent(values.certificate_chain); - values.private_key = encodeURIComponent(values.private_key); + values.certificate_chain = btoa(values.certificate_chain); + values.private_key = btoa(values.private_key); await apiClient.setTlsConfig(values); dispatch(setTlsConfigSuccess(config));