buglwIP - A Lightweight TCP/IP stack - Bugs: bug #56098, Support for MQTT over TLS port 443...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #56098: Support for MQTT over TLS port 443 instead of 8883

Submitter:  Richmond Umagat <richmond_umagat>
Submitted:  Mon 08 Apr 2019 12:19:48 PM UTC
   
 
Category:  apps Severity:  3 - Normal
Item Group:  Feature Request Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed Planned Release:  None
lwIP version:  git head

Tue 30 Apr 2019 11:27:21 AM UTC, comment #1: 

Applied, thanks!

Dirk Ziegelmeier <dziegel>
Group administrator
Mon 08 Apr 2019 12:19:48 PM UTC, original submission:  

To enable MQTT over TLS port 443 (instead of 8883), altcp_tls_mbedtls must provide a way to configure ALPN TLS extension.

This is essential as MQTT port 8883 is often blocked by IT departments and designers of routers. In fact, we encounter the issue in our Singapore office. For more info, refer to https://aws.amazon.com/blogs/iot/mqtt-with-tls-client-authentication-on-port-443-why-it-is-useful-and-how-it-works/

Below is a suggested API to be added in altcp_tls_mbedtls.c that can be called by users after calling altcp_tls_create_config_client or altcp_tls_create_config_client_2wayauth.


#if defined(ALTCP_MBEDTLS_ALPN_ENABLE)
int altcp_tls_conf_alpn_protocols(struct altcp_tls_config conf, const char *protos)
{
#if defined(MBEDTLS_SSL_ALPN)
    int ret = mbedtls_ssl_conf_alpn_protocols(&conf->conf, protos);
    if (ret != 0) {
        LWIP_DEBUGF(ALTCP_MBEDTLS_DEBUG, ("mbedtls_ssl_conf_alpn_protocols failed: %d\n", ret));
    }

    return ret;
#else
    return -1;
#endif
}
#endif


This has been tested working on AWS IoT cloud:

static const char *g_alpn_protocols[] = { "x-amzn-mqtt-ca", NULL };
tls_config = altcp_tls_create_config_client(ca, ca_len);
altcp_tls_conf_alpn_protocols(tls_config, g_alpn_protocols);

Richmond Umagat <richmond_umagat>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by dziegel (Posted a comment)
  • -email is unavailable- added by richmond_umagat (Submitted the item)
  • -email is unavailable- added by richmond_umagat (Support for MQTT over TLS port 443 instead of 8883)
  • -email is unavailable- added by richmond_umagat (Support for MQTT over TLS port 443 instead of 8883)
  • -email is unavailable- added by richmond_umagat (Support for MQTT over TLS port 443 instead of 8883)
  • -email is unavailable- added by richmond_umagat (Support for MQTT over TLS port 443 instead of 8883)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-04-30 dziegel StatusNone Fixed
        Open/ClosedOpen Closed
    2019-04-08 richmond_umagat Carbon-Copy- Added -email is unavailable-
        Carbon-Copy- Added -email is unavailable-
        Carbon-Copy- Added -email is unavailable-
        Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code