Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DNS query is issued in ssl_client's start_ssl_client method, even when IP address is provided #7350

Closed
1 task done
cziter15 opened this issue Oct 14, 2022 · 1 comment · Fixed by #7351
Closed
1 task done
Labels
Status: In Progress Issue is in progress

Comments

@cziter15
Copy link
Contributor

cziter15 commented Oct 14, 2022

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.
@cziter15 cziter15 added the Status: Awaiting triage Issue is waiting for triage label Oct 14, 2022
@cziter15 cziter15 changed the title DNS query is issued in ssl_client.cpp - connect method, even when IP address is provided DNS query is issued in ssl_client's start_ssl_client method, even when IP address is provided Oct 14, 2022
@VojtechBartoska
Copy link
Collaborator

Thanks for contribution, again, we'll review your PR and let you know :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: In Progress Issue is in progress
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants