diff --git a/app/src/actions/ConnectionManager.ts b/app/src/actions/ConnectionManager.ts index fce8cbed..7fb423ae 100644 --- a/app/src/actions/ConnectionManager.ts +++ b/app/src/actions/ConnectionManager.ts @@ -50,7 +50,19 @@ export const loadConnectionSettings = () => async (dispatch: Dispatch, getS } } -export type CertificateTypes = 'selfSignedCertificate' | 'clientCertificate' | 'clientKey' +// A Pre-shared-key is a symmetric encryption key, such as an AES-128 key, that is shared +// ahead of time (out of band) between the client and server. It might be programmed into +// the firmware at the factory for an IoT device. +// +// The server optionally sends a `psk_hint`, and the client sends a `pskIdentity` (also +// sometimes called an hint) that functions as a username. The server uses the `pskIdentity` +// to figure out which shared key to use, and they both encrypt using that key. +// +// For more information on the `psk` and `pskIdentity` options: +// See https://mosquitto.org/man/mosquitto-conf-5.html#idm854 "Pre-shared-key based SSL/TLS Support", and also +// mosquitto's `psk_file` option. + +export type CertificateTypes = 'selfSignedCertificate' | 'clientCertificate' | 'clientKey' | 'psk' export const selectCertificate = (type: CertificateTypes, connectionId: string) => async (dispatch: Dispatch, getState: () => AppState) => { try { diff --git a/app/src/components/ConnectionSetup/Certificates.tsx b/app/src/components/ConnectionSetup/Certificates.tsx index 0277c1a2..a1421739 100644 --- a/app/src/components/ConnectionSetup/Certificates.tsx +++ b/app/src/components/ConnectionSetup/Certificates.tsx @@ -2,7 +2,7 @@ import * as React from 'react' import CertificateFileSelection from './CertificateFileSelection' import Undo from '@material-ui/icons/Undo' import { bindActionCreators } from 'redux' -import { Button, Grid } from '@material-ui/core' +import { Button, Grid, TextField } from '@material-ui/core' import { connect } from 'react-redux' import { connectionManagerActions } from '../../actions' import { ConnectionOptions } from '../../model/ConnectionOptions' @@ -68,6 +68,16 @@ class Certificates extends React.PureComponent { certificateType="clientKey" /> + + +