secure mqtt connection with Non AWS IoT

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
joMa_1809706
Level 4
Level 4
10 likes received First like received First like given

Dev kit 3.5.2

Note I'm NOT using the AWS IoT (I have that working fine)

I can connect to HiveMQ broker fine  (iot.eclipse.org) using the unsecured example.

When using the snip.secure_mqtt example (modified with host lookup: if (wiced_hostname_lookup( MQTT_BROKER, &broker_address, 30000 ) != WICED_SUCCESS)

it hangs trying to connect.

I am using the supplied certificate in the example.

Is there something I'm missing in my setup?

0 Likes
8 Replies
AxLi_1746341
Level 7
Level 7
10 comments on KBA 5 comments on KBA First comment on KBA

jmartin wrote:

Dev kit 3.5.2

Note I'm NOT using the AWS IoT (I have that working fine)

I can connect to HiveMQ broker fine  (iot.eclipse.org) using the unsecured example.

When using the snip.secure_mqtt example (modified with host lookup: if (wiced_hostname_lookup( MQTT_BROKER, &broker_address, 30000 ) != WICED_SUCCESS)

it hangs trying to connect.

I am using the supplied certificate in the example.

Is there something I'm missing in my setup?

You need to use the certificate from http://iot.eclipse.org/iot.eclipse.org.crt

And also make sure using encrypted port 8883.

0 Likes

It still hangs when trying to open the connection.

Also if the certificate was a problem shouldn't the call to open return a certificate error rather than hanging?

0 Likes

can you point to which secure iot.eclipse.org you are referring to ?

0 Likes

#define MQTT_BROKER "iot.eclipse.org"

if (wiced_hostname_lookup( MQTT_BROKER, &broker_address, 30000 ) != WICED_SUCCESS)

{

WPRINT_APP_INFO(("broker lookup failed\n"));

}

else

{

WPRINT_APP_INFO(("[MQTT] Connecting to broker %u.%u.%u.%u ...\n", (uint8_t)(GET_IPV4_ADDRESS(broker_address) >> 24),

(uint8_t)(GET_IPV4_ADDRESS(broker_address) >> 16),

(uint8_t)(GET_IPV4_ADDRESS(broker_address) >> 8),

(uint8_t)(GET_IPV4_ADDRESS(broker_address) >> 0)));

}

Which gives

Connecting to broker 198.41.30.241 ...

0 Likes

Yes thats correct, I meant where in eclipse IoT you are referring to their secured connection ? Can you point me to a link where they describe their secure connection to their broker?

0 Likes

No, axel.lin pointed me to the cert. I don’t know how he found it. (see earlier post)

0 Likes

Whats the use case you are trying ?

0 Likes

The secure_mqtt project in sdk 3.5.2

0 Likes