peter-murray / node-hue-api

Node.js Library for interacting with the Philips Hue Bridge and Lights
Apache License 2.0
1.18k stars 144 forks source link

createLocal() throws net::ERR_CERT_AUTHORITY_INVALID #191

Closed Jin-hjs closed 3 years ago

Jin-hjs commented 3 years ago

hi there, I am new to nodejs/javascript and clueless as to what I'm missing. Calling createLocal() with the correct bridge ip throws this error:

err

The code below is pretty much identical to the example code:

v3.api.createLocal(newBridgeList[0].ipaddress).connect()
    .then(unauth => {
        return unauth.users.createUser(appName, deviceName);
    })
    .then(createdUser => {
        console.log(createdUser)
    })
    .catch(err => {
        discoveredBridge = null;
        allowShrinking = true;

        switch (err.getHueErrorType()) {
        case 101:
            console.error('Link button was not pressed.')
            ...
            break;
        default:
            console.error(`Unknown error: ${err.message}`);
        }
    });

using createInsecureLocal() instead works. Update: connecting to https://192.168.0.186/ via browser throws the same error, so this may not be the issue with the code afterall. If you could point me in the right direction, though, I would greatly appreciate it.

Jin-hjs commented 3 years ago

solved, not an issue with this library.