Add support for client certificates

This commit is contained in:
Ken-Håvard Lieng 2016-01-11 21:04:57 +01:00
parent d9b63dd0ef
commit 937560e859
20 changed files with 376 additions and 39 deletions

View file

@ -7,6 +7,7 @@ import messages from './messages';
import privateChats from './privateChats';
import search from './search';
import servers from './servers';
import settings from './settings';
import showMenu from './showMenu';
import tab from './tab';
@ -19,6 +20,7 @@ export default combineReducers({
privateChats,
search,
servers,
settings,
showMenu,
tab
});

View file

@ -0,0 +1,41 @@
import { Map } from 'immutable';
import createReducer from '../util/createReducer';
import * as actions from '../actions';
export default createReducer(Map(), {
[actions.UPLOAD_CERT](state) {
return state.set('uploadingCert', true);
},
[actions.SOCKET_CERT_SUCCESS]() {
return Map({ uploadingCert: false });
},
[actions.SOCKET_CERT_FAIL](state, action) {
return state.merge({
uploadingCert: false,
certError: action.message
});
},
[actions.SET_CERT_ERROR](state, action) {
return state.merge({
uploadingCert: false,
certError: action.message
});
},
[actions.SET_CERT](state, action) {
return state.merge({
certFile: action.fileName,
cert: action.cert
});
},
[actions.SET_KEY](state, action) {
return state.merge({
keyFile: action.fileName,
key: action.key
});
}
});