Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

[BUG] ALPN implementation issue #3516

Open
vvelciu opened this issue Jul 27, 2022 · 1 comment
Open

[BUG] ALPN implementation issue #3516

vvelciu opened this issue Jul 27, 2022 · 1 comment

Comments

@vvelciu
Copy link

vvelciu commented Jul 27, 2022

Describe the bug
SOCKETS_SetSockOpt with SOCKETS_SO_ALPN_PROTOCOLS option expects ALPN protocols to be provided as an array of char pointers.
However, this is misused in the transport_secure_sockets.c file in the tlsSetup() implementation:
image
Also, the mqtt_demo_mutual_auth, greengrass_discovery, ota demos configure the pAlpnProtos field as NULL (AWS_IOT_MQTT_ALPN and AWS_IOT_MQTT_ALPN_LENGTH macros are defined but left unused) and it would be nice to be properly set when the MQTT broker port is configured as 443.

System information

  • Project/Demo: mqtt_demo_mutual_auth

Expected behavior
Proper usage of SOCKETS_SetSockOpt, e.g.:
image

Screenshots or console output
The result of using pAlpnProtos similar to mqtt_demo_helpers.c implementation:
image

Steps to reproduce bug

  1. mqtt_demo_mutual_auth demo with port 443 configured as MQTT broker port
  2. Update prvConnectToServerWithBackoffRetries in mqtt_demo_mutual_auth.c file to configure pAlpnProtos (similar to mqtt_demo_helpers.c implementation):
    image
@dachalco
Copy link
Contributor

Hi @vvelciu

Thanks for catching this. Certainly a bug. I'd think SocketsConfig_t needs a change so that it has a char ** ppcAlpnProtos instead -- with corresponding demo changes. I'm preparing a PR for the matter.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants