From 3a9b06b884555271e66850047c783772f981f7b9 Mon Sep 17 00:00:00 2001 From: krr prr <24500376+krrprr@users.noreply.github.com> Date: Tue, 27 Oct 2020 15:19:54 +0200 Subject: [PATCH 1/2] feat: replace http with https --- package.json | 6 +++--- public/electron.js | 11 ++++++++++- src/constants.ts | 2 +- src/setup/ConnectToRemote.tsx | 2 +- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index ed6b8af..15b4b66 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ }, "main": "public/electron.js", "homepage": "./", - "version": "1.1.0-alpha.5", + "version": "1.1.0-alpha.6", "private": true, "dependencies": { "@fortawesome/fontawesome-svg-core": "^1.2.32", @@ -38,7 +38,7 @@ "rxjs": "^6.6.3" }, "scripts": { - "react-start": "react-scripts start", + "react-start": "HTTPS=true react-scripts start", "react-build": "react-scripts build", "react-test": "react-scripts test --env=jsdom", "react-eject": "react-scripts eject", @@ -47,7 +47,7 @@ "build": "yarn lint && yarn react-build && yarn electron-build --publish never", "build-all": "yarn lint && yarn react-build && yarn electron-build --publish never -mwl", "build-wl": "yarn lint && yarn react-build && yarn electron-build --publish never --win --linux", - "start": "concurrently --kill-others \"cross-env BROWSER=none yarn react-start\" \"wait-on http://localhost:3000 && electron .\"", + "start": "concurrently --kill-others \"cross-env BROWSER=none yarn react-start\" \"wait-on https://localhost:3000 && electron .\"", "test": "prettier --check src/ && yarn react-test", "lint": "eslint . --ext .js,.ts,.tsx", "prettier": "prettier --write src/" diff --git a/public/electron.js b/public/electron.js index 9394a58..dc0c676 100644 --- a/public/electron.js +++ b/public/electron.js @@ -25,7 +25,7 @@ function createWindow() { }); mainWindow.loadURL( isDev - ? "http://localhost:3000" + ? "https://localhost:3000" : `file://${path.join(__dirname, "../build/index.html")}` ); mainWindow.on("closed", () => (mainWindow = null)); @@ -59,3 +59,12 @@ app.on("activate", () => { createWindow(); } }); + +// SSL/TSL: self signed certificate support +app.on( + "certificate-error", + (event, _webContents, _url, _error, _certificate, callback) => { + event.preventDefault(); + callback(true); + } +); diff --git a/src/constants.ts b/src/constants.ts index 95c45af..910fae0 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -3,7 +3,7 @@ export const XUD_DISCORD_URL = "https://discord.com/invite/YgDhMSn"; export const XUD_DOCKER_DOCS_URL = "https://docs.exchangeunion.com/start-earning/market-maker-guide"; -export const XUD_DOCKER_LOCAL_MAINNET_URL = "http://localhost:8889"; +export const XUD_DOCKER_LOCAL_MAINNET_URL = "https://localhost:8889"; export const XUD_NOT_READY = [ "Error", diff --git a/src/setup/ConnectToRemote.tsx b/src/setup/ConnectToRemote.tsx index b863dc6..6806642 100644 --- a/src/setup/ConnectToRemote.tsx +++ b/src/setup/ConnectToRemote.tsx @@ -154,7 +154,7 @@ const handleConnectClick = ( ): void => { const address = xudDockerUrl.startsWith("http") ? xudDockerUrl - : `http://${xudDockerUrl}`; + : `https://${xudDockerUrl}`; setConnecting(true); api.statusByService$("xud", address).subscribe({ next: () => { From 2e0404b2d4ac83733a45155f97c1bba249b5c5b3 Mon Sep 17 00:00:00 2001 From: krr prr <24500376+krrprr@users.noreply.github.com> Date: Fri, 6 Nov 2020 17:23:34 +0200 Subject: [PATCH 2/2] v1.1.0-alpha.7 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 15b4b66..44b024b 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ }, "main": "public/electron.js", "homepage": "./", - "version": "1.1.0-alpha.6", + "version": "1.1.0-alpha.7", "private": true, "dependencies": { "@fortawesome/fontawesome-svg-core": "^1.2.32",