cashubtc / eNuts

A Cashu wallet for Android and iOS 🥜🐿️
https://enuts.cash
GNU General Public License v3.0
190 stars 25 forks source link

Improve error message details when adding mint fails #364

Open jblachly opened 2 months ago

jblachly commented 2 months ago

I am trying to add a test mint (Moksha, in this case) while home on my LAN (192.168.1.0/24). However, while I can connect to the mint from other computers on the LAN with CLI wallets (and with curl), I am not able to add this mint to eNuts. The error message "Network request failed" is sufficiently generic that I am not sure whether this is a socket connection failure, or a higher-level protocol failure.

Version: iOS 0.4 beta (enable access to LAN for eNuts beta is enabled in settings) Mint url: http://192.168.1.x:yyyyy (note http, not https; and a nonstandard port)

I would love it if the error were more specific to help debug setup. "Couldn't connect" or "HTTPS expected", etc.

Thanks for considering

KKA11010 commented 2 months ago

Hi @jblachly , thanks a lot for opening the issue.

From my experience, I can say with almost 99% certainty that iOS restricts requests that are not over HTTPS. This has also happened to me even in dev environments. sometimes it would randomly work, but more often it fails due to security policies I believe.

Unfortunately, it might be tricky to differentiate between specific error types such as 'couldn't connect' or 'HTTPS expected' because they are often masked as generic network failures. However, I’ll keep this in mind as a possible improvement for the future.

Thanks again for bringing this up!