diff --git a/src/apps/altcp_tls/altcp_tls_mbedtls.c b/src/apps/altcp_tls/altcp_tls_mbedtls.c
index f3a07e30..9f419223 100644
--- a/src/apps/altcp_tls/altcp_tls_mbedtls.c
+++ b/src/apps/altcp_tls/altcp_tls_mbedtls.c
@@ -945,6 +945,21 @@ altcp_tls_create_config_client_2wayauth(const u8_t *ca, size_t ca_len, const u8_
return conf;
}
+int
+altcp_tls_configure_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
+}
+
void
altcp_tls_free_config(struct altcp_tls_config *conf)
{
diff --git a/src/include/lwip/altcp_tls.h b/src/include/lwip/altcp_tls.h
index 4239c125..5f1cb7c4 100644
--- a/src/include/lwip/altcp_tls.h
+++ b/src/include/lwip/altcp_tls.h
@@ -94,6 +94,15 @@ struct altcp_tls_config *altcp_tls_create_config_client_2wayauth(const u8_t *ca,
const u8_t *privkey_pass, size_t privkey_pass_len,
const u8_t *cert, size_t cert_len);
+/** @ingroup altcp_tls
+ * Configure ALPN TLS extension
+ * Example:
+ * 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);
+ */
+int altcp_tls_configure_alpn_protocols(struct altcp_tls_config *conf, const char **protos);
+
/** @ingroup altcp_tls
* Free an ALTCP_TLS configuration handle
*/