streamdeck icon indicating copy to clipboard operation
streamdeck copied to clipboard

How to make request to HTTPS server with self-signed certificates

Open t1m0thyj opened this issue 10 months ago • 1 comments

I know this is generally not advised for security reasons, but may be necessary if the server is running on a local network, such as the Pi-hole plugin for Stream Deck - see https://github.com/johnholbrook/streamdeck-pihole/issues/22#issuecomment-2733998302.

So far I haven't been able to find a way to connect to an HTTPS server and ignore self-signed certificates with XmlHttpRequest or the fetch API, but am wondering if this is possible somehow?

t1m0thyj avatar Mar 18 '25 22:03 t1m0thyj

Hi @t1m0thyj,

I'm by no means an expert on this topic, so I'll leave the conversation open for other to contribute, but you might be able to try setting rejectAuthorization to false. It could look something like

const https = require("https");
const agent = new https.Agent({
	rejectUnauthorized: false,
});

fetch("https://your-local-server.com/", { dispatcher: agent })
	.then((response) => response.text())
	.then((data) => {
		streamDeck.logger.info(data);
	})
	.catch((error) => {
		streamDeck.logger.error(error);
	});

ChekTek avatar Mar 26 '25 20:03 ChekTek

This issue was closed because it has been inactive for one week since being marked as stale.

github-actions[bot] avatar Jun 02 '25 02:06 github-actions[bot]