Open vvelciu opened 1 year ago
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.
Describe the bug _SOCKETSSetSockOpt with _SOCKETS_SO_ALPNPROTOCOLS option expects ALPN protocols to be provided as an array of char pointers. However, this is misused in the _transport_securesockets.c file in the tlsSetup() implementation:
Also, the _mqtt_demo_mutual_auth, greengrassdiscovery, 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
Expected behavior Proper usage of _SOCKETSSetSockOpt, e.g.:![image](https://user-images.githubusercontent.com/11376393/181211735-a27a4eb5-eb6c-470a-90d0-394ce89088f1.png)
Screenshots or console output The result of using pAlpnProtos similar to _mqtt_demohelpers.c implementation:![image](https://user-images.githubusercontent.com/11376393/181213597-fb0cb81f-f8ca-44aa-9cb4-167d2b683097.png)
Steps to reproduce bug