Closed
Description
No details about the device required as whole ecosystem is affected.
Affected component: WiFiClientSecure, ssl_client and probably more...
Description
When using WiFiClient secure and passing IPAdddress, unnecessary DNS query flow is issued. Why is it ever calling hostByName function? That's probably caused by confusion of mbedtls hostname with endpoint hostname. On Arduino-esp8266 NULL is passed as hostname in this situation.
Expected resoultion:
When providing raw IP address, no DNS query should be issued. This can be partially fixed by #7351.
Hostname should be NULL (like in esp8266 Arduino core) or should be able to be defined by the user.
Sketch
WiFiClientSecure clientSecure;
clientSecure->setInsecure(); // << -- to allow self signed and skip some verification
IPAddress serverIp;
if (serverIp.fromString("192.168.1.111"))
{
clientSecure.connect(serverIp, 443); // << -- this will trigger unnecessary DNS querying for IP address.
}
I have checked existing issues, online documentation and the Troubleshooting Guide
- I confirm I have checked existing issues, online documentation and Troubleshooting guide.