diff --git a/internal_packages/onboarding/lib/page-self-hosting-config.jsx b/internal_packages/onboarding/lib/page-self-hosting-config.jsx index 62eaab966..bc84e5928 100644 --- a/internal_packages/onboarding/lib/page-self-hosting-config.jsx +++ b/internal_packages/onboarding/lib/page-self-hosting-config.jsx @@ -14,6 +14,7 @@ class SelfHostingConfigPage extends React.Component { constructor(props) { super(props) this.state = { + usesHTTPS: false, url: "", port: "", error: null, @@ -32,6 +33,12 @@ class SelfHostingConfigPage extends React.Component { }) } + _onChangeProtocol = (event) => { + this.setState({ + usesHTTPS: !this.state.usesHTTPS, + }) + } + _addAccountJSON = () => { // Connect to local sync engine's /accounts endpoint and add accounts to N1 const xmlHttp = new XMLHttpRequest() @@ -57,7 +64,7 @@ class SelfHostingConfigPage extends React.Component { return } NylasEnv.config.set('env', 'custom') - NylasEnv.config.set('syncEngine.APIRoot', `http://${this.state.url}:${this.state.port}`) + NylasEnv.config.set('syncEngine.APIRoot', `http${this.state.usesHTTPS ? "s" : ""}://${this.state.url}:${this.state.port}`) Actions.setNylasIdentity({ token: "SELFHOSTEDSYNCENGINE", firstname: "", @@ -116,7 +123,7 @@ class SelfHostingConfigPage extends React.Component {