I have a JavaScript app that can connect to various external IoT devices using HTTPS.
The user of the app needs to have the certificate installed from the IoT device in order to connect.
In case the app cannot connect to the device because of a certificate problem, I want to show a specific message in the browser. Though it appears that the error message Axios provides does not disclosure any details (cert problem yes nor no?) about what went wrong.
It basically shows ERR_NETWORK
, the same for when the connection timed out.
So this error is not sufficient to identify a certificate problem.
Another idea
I noticed it might be possible to leverage timin, as the above error pops up relatively fast. A normal timeout would take e.g. 10s, whereas the certifcate error pops up almost instantaneous.
But.. I noticed as well that Chrome caches unreachable hosts, meaning timeouts will also occur faster after some tries.
So the question: How is it possbile to make sure Axios is doing its request always and not timeout faster for successive requests? Adding a random number as a query param did not solve.
2