Convert certificate and key to base64

This commit is contained in:
Ildar Kamalov 2019-02-01 13:57:39 +03:00 committed by Eugene Bujak
parent 4da55dc2aa
commit 93847bd309

View file

@ -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));