I'm working on a local React app that needs to connect to QZ Tray over HTTPS. I want the app to run locally at https://192.168.1.35:3010, and I've tried providing all the necessary certificates in Node.js. My server.js looks like this:
const https = require("https");const fs = require("fs");const { Express } = require("./app");const port = 3010;const options = { key: fs.readFileSync("./certs/192.168.1.35-key.pem"), cert: fs.readFileSync("./certs/192.168.1.35.txt"),};https.createServer(options, Express).listen(port, () => { console.log(`Server running on https://192.168.1.35:${port}`);});In the browser console, I see:
GET https://192.168.1.35:3010/qz-public-cert net::ERR_CERT_AUTHORITY_INVALIDFailed to get certificate: TypeError: Failed to fetchAnd QZ Tray shows:
- "An anonymous request wants to connect to QZ Tray – Untrusted website"
- Certificate details show Common Name: An anonymous request
I've tried providing .pem, .key, and .txt files as certificates, but it still doesn't work.
My questions:
- How can I make QZ Tray trust my local HTTPS server certificate?
- Is there a recommended way to generate self-signed certificates for QZ Tray on a local network?
- Can I run QZ Tray with https:// locally without manually approving every request?
Environment:
- Windows 11
- Node.js 22
- React 19
- QZ Tray 2.2.5