This is an internal documentation. There is a good chance you’re looking for something else. See Disclaimer.

Running Widgets over SSL on localhost

This setup is using mkcert and is based on these resources:


Never export or share the file rootCA-key.pem mkcert creates automatically!


For Firefox you need to install brew install nss as well.

  1. Install mkcert:

  2. Install root certiciate authority: mkcert -install

  3. Add your domains to your hosts file (e.g. tocco.customer.localhost for nice2 and customer.localhost for the website)

  4. Create certiciate for the website mkcert customer.localhost

  5. Create certiciate for nice2 mkcert -pkcs12 tocco.customer.localhost

  6. Copy the created tocco.customer.localhost.p12 certificate to /customer/test/src/main/resources

  7. Add following properties to nice2

  1. Add created certificate to website server /scripts/widgets/server.js

const fs = require('fs')
const https = require('https')


const privateKey = fs.readFileSync('/<...>/customer.localhost-key.pem')
const certificate = fs.readFileSync('/<...>/customer.localhost.pem')

      key: privateKey,
      cert: certificate
  1. Set correct backend url to website server /scripts/widgets/server.js

const backendUrl = process.env.BACKEND_URL || 'https://tocco.customer.localhost:8080'
<script>window.toccoBackendUrl = "https://tocco.customer.localhost:8080";</script>
<script src="https://tocco.customer.localhost:8080/js/tocco-widget-utils/dist/bootstrap.js"></script>
  1. Run nice2: https://tocco.customer.localhost:8080

  2. Run website server yarn widgets:serve: https://customer.localhost:3000?key=<widget-config-key>

    The website server simulates a website which embeds a widget. By passing a valid widget config key on the query parameter key it will automatically embed this widget.


When having a login widget configured you can simulate to login on the website via the login widget by passing the login widget key to the website url. After successful login the cookie is set and you can open any another widget by passing another widget config key.