SSLClient icon indicating copy to clipboard operation
SSLClient copied to clipboard

does SSLClient support SNI - Server Name Identification - ?

Open kgmuzungu opened this issue 1 year ago • 2 comments

Some MQTT broker require SNI support for authentication (e.g. see here https://community.hivemq.com/t/connecting-to-private-broker-with-esp32-sim800l/2126 and https://community.hivemq.com/t/client-is-not-authorized-to-connect/856/37) Does SSLClient support that? How could I set this field? Do I have to enable SNI on the modem side (in my case a SIM800L) and set a hostname in SSLClient?

kgmuzungu avatar Feb 15 '24 06:02 kgmuzungu

Does SSLClient support that?

It is already part of the connection process, based on the hostname you provide for connection. The SNI is part of the connection sequence here: https://github.com/govorox/SSLClient/blob/eee87188d2a63f115681c836083d4cbc9f45e76d/src/ssl_client.cpp#L324

with the actual routine here: https://github.com/govorox/SSLClient/blob/eee87188d2a63f115681c836083d4cbc9f45e76d/src/ssl_client.cpp#L599-L616

Do I have to enable SNI on the modem side (in my case a SIM800L)

No, as this is not utilizing any of the SSL/TLS functionality in your modem. The entire SSL functionality is completely handled in the main processor.

WebDust21 avatar Feb 18 '24 21:02 WebDust21

@kgmuzungu are you good with this now? If you have had success I will mark this issue as closed. If not please update the issue with more about the exact problem you are facing. Thank you.

RobertByrnes avatar Mar 08 '24 20:03 RobertByrnes

Closing as no more messages. Closing with the understanding that yes this library supports server name Identification.

RobertByrnes avatar Apr 30 '24 20:04 RobertByrnes