Crypto: randomUUID() is only available in a secure context #563
-
The frontend app makes use of the Crypto: randomUUID() method from the Web Crypto API. That method is only available in secure contexts. Hence the application only works when using HTTPS or when running on localhost (which is also a secure context). In non-secure contexts, the web app fails with The tool looks very promising! Great work! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Thank you! |
Beta Was this translation helpful? Give feedback.
-
Hi, I ran into the same issue when trying to run it from docker on a server in my local network. Would be great to extend the docker compose instructions with how to add the keystore to the template. For example, I used this now: version: "3.8"
services:
database:
image: postgres:12
environment:
POSTGRES_DB: postgres
POSTGRES_USER: username
POSTGRES_PASSWORD: password
networks:
- syson
app:
image: eclipsesyson/syson:v2024.7.0
ports:
- "8080:8080"
environment:
SPRING_DATASOURCE_URL: jdbc:postgresql://database/postgres
SPRING_DATASOURCE_USERNAME: username
SPRING_DATASOURCE_PASSWORD: password
SIRIUS_COMPONENTS_CORS_ALLOWEDORIGINPATTERNS: "*"
SERVER_PORT: 8080
volumes:
- ./keystore.jks:/keystore.jks
depends_on:
- database
networks:
- syson
entrypoint:
- java
- -jar
- /app.jar
- --server.ssl.key-store=./keystore.jks
- --server.ssl.key-store-password=password
- --server.ssl.key-store-type=JKS
- --server.ssl.key-alias=myalias
- --server.ssl.key-password=password
networks:
syson: |
Beta Was this translation helpful? Give feedback.
Thank you!
Yes you're right, the application only works when using HTTPS or when running on localhost (which is also a secure context).
In the recently recently released documentation, a section is dedicated to this subject.
Please see: https://doc.mbse-syson.org/syson/main/installation-guide/how-tos/https.html
(Note that our solution is for tests purpose only. For production deployments, you will need to obtain a valid certificate from a trusted CA to ensure secure and reliable communication.).