Local cloud & SSL (https)

hi everyone, is there a way to set up a local cloud with SSL?

for example, instead of:


i can tap into my local cloud as:


i cannot figure out how to go about doing this. my local cloud on a rpi otherwise works well.

1 Like

Hi @chuank,

Good question! Checkout this line of code in the spark-server:


Just update that to use node’s built in https instead, docs here:




Thanks @Dave, much appreciated!

1 Like

Hi Dave,
Can you repost your first link? I can’t find the line that you are referring to.

Hi @skyw33,

Weird that the link isn’t there anymore, I think it was something like…


Thank you @Dave! I was able to get https working with curl on my local server. I now have what I think is a related issue. When I use the command

particle flash [device_id] firmware.bin

I get the error

flash device got error: {“code”:“DEPTH_ZERO_SELF_SIGNED_CERT”}

I think it might be related to certificates that need to be applied to particle-cli in the same way that I applied them to spark-server, but I can’t figure out what I should change. Do you have any suggestions?
Thanks again!

Hi @skyw33,

Sounds like the certificate you’re using wasn’t signed by a certificate authority, so the CLI can’t tell if its genuine or not. You can modify the CLI and tell it you don’t care about the authenticity of the certificate by adding a param to the request:

// in lib/ApiClient.js

	//PUT /v1/devices/{DEVICE_ID}
	flashDevice: function (coreID, files) {
		console.log('attempting to flash firmware to your device ' + coreID);

		var that = this;
		var dfd = when.defer();
		var r = request.put(this.baseUrl + '/v1/devices/' + coreID + '?access_token=' + this._access_token, {
			json: true,
                        // add this line: will tell it to ignore a bad certificate -- don't forget the comma above!
                        rejectUnauthorized: false


1 Like

@Dave – Brilliant!!! Worked like a charm :smile:

1 Like