Still issues with connecting to MQTT broker on port 8883

During the contest I had to substitute MQTT for HTTPS due to issues with the board connecting to MQTT on secure ports. I had attempted connecting to Azure IoT hubs without success and now I am attempting to connect to my own broker without success. The error I get from monitoring the broker is as follows:

1460342331: New connection from ##.##.##.### on port 8883. 1460342332: OpenSSL Error: error:140940E5:SSL routines:SSL3_READ_BYTES:ssl handshake failure 1460342332: Socket error on client <unknown>, disconnecting.

I did have similar from an Intel Galileo with a Python package I have created but this was solved by setting the correct time on the board. I am wondering if the issue with the MKR1000 is due to the same issue as I have uploaded the required CA for my broker and out of my 3 commercial boards this is the only board I can now not connect to via MQTT.

I can’t seem to find any info on changing the time on the MKR1000 does anyone know so that I can eliminate this as a possible cause for the connection issue.

Hi, as mentioned here https://github.com/arduino/cloud-examples/issues/3 please try the examples here https://cloud.arduino.cc/ as they are based on a MQTTS server

@AdamMiltonBarker please see my comments in arduino/cloud-examples/issues/3.

Sandeep have replied mate, thanks AndreaRichetta will check it out now.

AndreaRichetta: Hi, as mentioned here https://github.com/arduino/cloud-examples/issues/3 please try the examples here https://cloud.arduino.cc/ as they are based on a MQTTS server

It doesn't mention there to try it I said that it wasn't working with anything. That is actually my topic linked to above. So this is working with Python and Node JS on both websockets now and 8883 but currently not working with Arduino. Any other advice on solving this, it is not a case of trying a different broker as this is functioning with other languages and libraries on both 8883 and 9001.

Have added websockets now and nothing on either ports 8883 or 9001 I have now got applications running from Mac / PC / Node JS / Python / Intel Galileo / Raspbery Pi all able to connect with no issues to either port 8883 or 9001 for websockets, I have uploaded the ca file again which is a chain from Comodo and still nothing. Error from broker:

OpenSSL Error: error:140940E5:SSL routines:SSL3_READ_BYTES:ssl handshake failure

Hi, we've heard back from Atmel, SHA-384 certificate support is scheduled to be added in the June 2016 firmware release. Also, as of now, there are no plans to support SHA-512.

No problem was hoping to be able to create samples for iot.techbubbletechnologies.com beta testers but guess will just have to wait until the software used on the MKR1000 is up to scratch.

Hi AdamMiltonBarker, in this month we made a lot of improvement, have you had the chance to test again ?

thanks

To follow up on this, there is another thread on Github for this: https://github.com/arduino/cloud-examples/issues/3#issuecomment-209627682

The issue was a small max. packet size in the PubSubClient library:

If you look inside PubSubClient.h you can see the default buffer size is #define MQTT_MAX_PACKET_SIZE 128.

My SHAREDACCESSSIGNATURE had a size of 138 bytes, so the library will overflow the buffer. I changed this to #define MQTT_MAX_PACKET_SIZE 1280 just to be on the safe side and made a successful connection.