According to a previous post, libcurl-dev, but I’m not sure what the different dev flavours are:
That shouldn’t be a problem, but 4.2.1 won’t fix falling back to curl without the proper libcurl package installed and shouldn’t be too different from 5.x using the legacy provider. NameResolutionFailure is possibly a DNS problem, or something on the host not resolving it, IIRC Ubuntu has a bug with name resolution in recent versions that can cause issues.