mobizt / ESP_SSLClient

The upgradable Secure Layer Networking (SSL/TLS) TCP Client for Arduino devices that support external networking interfaces e.g., WiFiClient, EthernetClient, and GSMClient.
MIT License
18 stars 2 forks source link

Allow custom Port #7

Closed rjjrbatarao closed 2 months ago

rjjrbatarao commented 2 months ago

Hi thanks for the example earlier, I finally saw the culprint to my problem its mIsSecurePort allows only predefined secure ports in my case Im using a custom port like 5353 or 5443, I added my custom port on the ESP_SSLClient_Const.h _secure_ports and finally it worked!!. Maybe you can provide a flag or method to turn off the checking?, THank you.

mobizt commented 2 months ago

Your request ports are not standard secure port.

It needs more works to support user defined port more than allowing connection but the types of ports (Plain, SSL, TLS, STARTTLS) should be defined by user together with the port number.

The email client library that uses this ssl client allows user to connect to custom IMAP and SMTP ports.

This is not hard to implement but it needs the time, and I will update here when it becomes available.

rjjrbatarao commented 2 months ago

Thank you, I see, I have implemented a server where you can change the port of your choice thats why im not using any standard port for this giving it flexibility over firewalls etc. For now I have disabled the checking on the source file, Its good to have a means of disabling this for more flexibility.

mobizt commented 2 months ago

I think that I don't have to do anything to allow non-standard secure ports as you can connect in plain text mode then upgrade as in this example.

mobizt commented 2 months ago

You don't have to modify the source when your port does not in the list, you can upgrade as example above.

This should be done in user code or application that uses this library to manually upgrade to secure connection in case non-standard secure port as implemented in my email client library that does not touch the ssl client library source.

mobizt commented 2 months ago

I close this issue now as the alternate option is available.

mobizt commented 2 months ago

I test with any non-standard secure port e.g. 5443 by upgrading with ssl_client.connectSSL() and it works as expected.

rjjrbatarao commented 2 months ago

Amazing!! Im now using it with my custom port without touching the source code, thank you for this awesome trick :)