-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IoT Core MQTT Sample - Error: self signed certificate #1563
Comments
@gguuss Can you have a look at this IoT problem please. Thanks |
Did you set the CA certificate configuration to a custom one at the registry level? I am not sure I have seen this error when using the default cert setup. Also are you using the LTS MQTT bridge or the |
@prenna Let me know if checking whether you're using the root certificate matches the MQTT server you're using works. |
Hi, sorry about the delay... So, it turns out, I was trying to be too clever. Since I'm using Typescript, I was getting told that const connectionArgs: mqtt.IClientOptions = {
host: mqttBridgeHostname,
port: mqttBridgePort,
clientId: mqttClientId,
username: deviceId,
password: createJWT(projectId, privateKeyFile, algorithm),
protocol: 'mqtts',
protocolId: 'TLSv1_2_method'
}
mqtt.connect(opts) I changed 'protocolId' back to 'secureProtocol' and told typescript to ignore it and all is working as expected now. As a side note I feel like something is missing in the docs here: https://cloud.google.com/iot/docs/how-tos/mqtt-bridge#downloading_mqtt_server_certificates At the end of the section 'Downloading MQTT server certificates' the sentence
'configure an MQTT client to authenticate the device' is a link to a section on the page that doesn't exist. There's nothing else in the documentation or in the code samples that explains or demonstrates what to do with the Google root CA certificate. Is it even needed? |
The root certificate is needed to verify that the Google server "says who you think it is" but this check can be disabled. |
Trying the mqtt example, but when I run and try to connect I get the following error through to
client.on('error', error...
I've generated a device key pair as per the docs, checked that the JWT is valid etc. I can't find any mention of this being an issue for anyone else anywhere. Please help.
The text was updated successfully, but these errors were encountered: