strongbox-password-safe / Strongbox

A KeePass/Password Safe Client for iOS and OS X
https://strongboxsafe.com
GNU Affero General Public License v3.0
1.33k stars 102 forks source link

iOS Sync Nextcloud - IPv6 #735

Closed christianbur closed 10 months ago

christianbur commented 11 months ago

Currently I cannot perform a Webdav sync with the Strongbox iOS APP in the local network (iPhone and Nextcloud server in the same subnet). In the mobile network with VPN the sync works without any problems. The Webdav URL can be opened on the iPhone (Safari) without any problems, also keepassium (on iphone) works with Webdav in the local network. The Strongbox app on the Macbook can also perform a webdav sync with the local Netxcloud server without any problems.

I suspect the problem is related to IPv6. Because the iOS APP reports "The Internet connection appears to be offline". The online check is probably done by calling duckduckgo.com. The app requests the ipv6 address of duckduckgo.com (AAAA record), but duckduckgo.com has no ipv6 address. Since the Nextcloud server is located in the local network, not only duckduckgo.com (ipv4 only) should be checked, but also ipv6 and the webdav server itself (because no internet is required for the sync).

Similar problem: https://github.com/strongbox-password-safe/Strongbox/issues/603#

Logs:

06:59:52.637 [In Bearbeitung] - Begin Sync [Interactive=NO, outstandingUpdate=NO, forcePull=0, provider=WebDAV, workingCacheMod=2023-11-07 05:37:36.000, lastCheckedSourceMod=2023-11-07 05:37:36.000]
06:59:52.721 [Fehler] - Error Domain=NSURLErrorDomain Code=-1009 "Es besteht anscheinend keine Verbindung zum Internet." UserInfo={NSUnderlyingError=0x282dd18c0 {Error Domain=kCFErrorDomainCFNetwork Code=-1009 "Es besteht anscheinend keine Verbindung zum Internet." UserInfo={NSLocalizedDescription=Es besteht anscheinend keine Verbindung zum Internet., NSErrorFailingURLStringKey=https://nextcloud.local.test.de/remote.php/webdav/Keepass, _kCFStreamErrorDomainKey=1, _kCFStreamErrorCodeKey=50, NSErrorFailingURLKey=https://nextcloud.local.test.de/remote.php/webdav/Keepass, _NSURLErrorNWPathKey=satisfied (Path is satisfied), interface: en0[802.11], ipv4, ipv6, dns, uses wifi}}, NSErrorFailingURLStringKey=https://nextcloud.local.test.de/remote.php/webdav/Keepass, NSErrorFailingURLKey=https://nextcloud.local.test.de/remote.php/webdav/Keepass, _kCFStreamErrorDomainKey=1, _kCFStreamErrorCodeKey=50, NSLocalizedDescription=Es besteht anscheinend keine Verbindung zum Internet.}
strongbox-mark commented 11 months ago

Wow, that's super weird. The error (code -1009) is actually coming from the system, it's not related to the DDG check, which is a separate check and if it was detecting you're offline it would ask you what you'd like to do rather than fail, so that's unrelated.

I've been searching for this online and it does appear to occur every now and then but there's no good advice on what could be causing this (search term: "nsurlerrordomain error 1009"), this response from Apple is not v helpful:

https://developer.apple.com/forums/thread/81350

I'm afraid I don't know what could be the issue here. It could be/probably is something to do with your network configuration. I'd love to hear more about the setup, what works what doesn't. I would guess KeePassium is using a different method of connecting that we do (we use a older library and it uses NSURLSession which is a little out dated). We have a longer term plan to upgrade this connectivity for WebDAV but for most it just works out of the box. Sorry that's not super helpful.

christianbur commented 11 months ago

I had, probably by mistake, withdrawn Strongbox's access to the local network.

Iphone -> Settings app and tap Privacy & Security -> Local Network. https://www.businessinsider.com/guides/tech/local-network-access-iphone

strongbox-mark commented 10 months ago

Yep, that'll do it too :) Thanks for letting me know.