Skip to content

Commit 5800d39

Browse files
committed
Remove SSL cert for localhost
This commit removes SSL certification creation and usage when running webviz. The onus is on the process that connects to the internet to handle HTTPS, eg. Azure's firewall.
1 parent 9b2aa79 commit 5800d39

12 files changed

+57
-298
lines changed

.github/workflows/webviz-config.yml

-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ jobs:
6868
6969
- name: 🤖 Run tests
7070
run: |
71-
webviz certificate
7271
webviz preferences --theme default
7372
pytest ./tests --headless --forked
7473
webviz docs --portable ./docs_build --skip-open

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88

99
## [0.2.7] - 2021-01-14
1010

11+
### Changed
12+
- [#374](https://github.com/equinor/webviz-config/pull/374) - Removed Webviz
13+
SSL certificate generation and forcing of HTTPS connections.
14+
1115
### Changed
1216
- [#368](https://github.com/equinor/webviz-config/pull/368) - Made Webviz global
1317
settings available to plugin implementations through special `webviz_settings`

INTRODUCTION.md

+25-7
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,32 @@ webviz build ./examples/basic_example.yaml
8282
and then modify `./examples/basic_example.yaml` while the Webviz application is
8383
still running, a hot reload will occur.
8484

85-
#### Localhost certificate
85+
#### Localhost HSTS
8686

87-
For quick local analysis, `webviz-config` uses `https` and runs on `localhost`.
88-
In order to create your personal :lock: `https` certificate (only valid for `localhost`), run
89-
```bash
90-
webviz certificate --auto-install
91-
```
92-
Certificate installation guidelines will be given when running the command.
87+
Previous versions of webviz generated a local certificate to force localhost
88+
connections to go through HTTPS. This is no longer the case and localhost
89+
connections use HTTP. As such, the `webviz certificate` command has been
90+
deprecated.
91+
92+
Some browsers will force HTTPS and require extra steps to remove this security.
93+
Note that this is safe as no external computer may connect to a localhost
94+
server.
95+
96+
If you're having issues connecting to a localhost server running Webviz due to
97+
security issues, perform the following steps:
98+
99+
##### Google Chrome and Chromium
100+
101+
These are the steps to remove HSTS, a security feature that forces HTTPS
102+
connections even though the user has specified HTTP:
103+
104+
1. Navigate to chrome://net-internals/#hsts
105+
2. In the **Delete domain security policies**, type in "localhost" and click
106+
delete
107+
108+
##### Firefox
109+
110+
Firefox does not have issues connecting to localhost addresses over HTTP.
93111

94112
#### User preferences
95113

tests/test_portable.py

-9
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,6 @@ def test_portable(dash_duo, tmp_path):
99
["webviz", "build", "basic_example.yaml", "--portable", appdir], cwd="examples"
1010
)
1111

12-
# Remove Talisman
13-
filename = appdir / "webviz_app.py"
14-
with open(filename, "r") as filehandle:
15-
lines = filehandle.readlines()
16-
with open(filename, "w") as filehandle:
17-
for line in lines:
18-
if not line.strip("\n").startswith("Talisman"):
19-
filehandle.write(line)
20-
2112
# Import generated app
2213
sys.path.append(str(appdir))
2314
from webviz_app import app # pylint: disable=import-error, import-outside-toplevel

webviz_config/_docs/open_docs.py

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ def _index() -> str:
3030
host="localhost",
3131
port=port,
3232
debug=False,
33-
ssl_context=webviz_config.certificate.LocalhostCertificate().ssl_context,
3433
)
3534

3635

webviz_config/_localhost_token.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,13 @@
77

88

99
class LocalhostToken:
10-
"""Uses a method similar to jupyter notebook (however, here we do it over
11-
https in addition). This method is only used during interactive usage on
12-
localhost, and the workflow is as follows:
10+
"""Uses a method similar to jupyter notebook. This method is only used during
11+
interactive usage on localhost, and the workflow is as follows:
1312
1413
- During the flask app building, a one-time-token (ott) and a cookie_token
1514
is generated.
1615
- When the app is ready, the user needs to "login" using this
17-
one-time-token in the url (https://localhost:{port}?ott={token})
16+
one-time-token in the url (http://localhost:{port}?ott={token})
1817
- If ott is valid - a cookie with a separate token is set, and the
1918
one-time-token is discarded. The cookie is then used for subsequent
2019
requests.

webviz_config/certificate/__init__.py

-1
This file was deleted.

webviz_config/certificate/_certificate_generator.py

-228
This file was deleted.

webviz_config/certificate/_localhost_certificate.py

-39
This file was deleted.

0 commit comments

Comments
 (0)