You are reading a single comment by @lukevanhorn and its replies. Click here to read the full conversation.
  • Thanks @heri16 & @Gordon!

    On initial testing, I'm getting a 0x4310 mbedtls_ssl_handshake error. (This does work when using another client to test, so I know my keys and policy is valid.)

    Here's the test code:

    SPI3.setup({ mosi:B5, miso:B4, sck:B3 });
    var eth = require("WIZnet").connect(SPI3, A8);
    eth.setIP();
    eth.getIP();
    
    var options = url.parse("mqtt://A0123456789AA.iot.us-east-1.amazonaws.com:8883");
    options.key = atob("MIIEow ... d4/IvHs");
    options.cert = atob("MIIDWj ... +NrCQ==");
    options.ca = atob("MIIE0z ... dao7WNq");
    
    var mqtt = require("MQTT").create();
    mqtt.on('connected', function() {
    	mqtt.subscribe("test");
    });
    
    require("tls").connect(options, function(res) {
      mqtt.connect(res);
    });
    

    And the output:

    >echo(0);
    > Send DHCP_DISCOVER
    > Receive DHCP_OFFER
    > Send DHCP_Request
    > Receive DHCP_ACK
    Connecting with TLS...
    Loading the CA root certificate...
    Loading the Client certificate...
    Loading the Client Key...
    Performing the SSL/TLS handshake...
    =undefined
    Client connected
    ERROR: Failed! mbedtls_ssl_handshake returned -0x4310
    ERROR: Socket error -1 while sending
    ERROR: Failed! mbedtls_ssl_handshake returned -0x4310
    MQTT client disconnected
    

    Gordon, I'll message you the code snippet with test keys as this may help in debugging. I'll continue to debug from my side as well.

    Thanks,
    Luke

About

Avatar for lukevanhorn @lukevanhorn started