P2P replication error in distribution build

My iOS app using Couchbase Lite 1.4.1 does P2P replication with SSL, which works fine in a debug build running on device or simulator. However, when I test with a test build distribution the replication request fails with “Invalid response from remote replication server”. Replicating from a device running the debug build to a device running the distribution build works, but the other way around is failing.

Any insight as to why this would be happening?

Look for messages in the console about the error. My best guess is that this has something to do with App Transport Security being somehow stricter in the for-distribution app. It’d be best if you filed an issue on Github (against couchbase/couchbase-lite-ios.)

Late response, but the problem was indeed in app transport security. Turning on NSAllowsLocalNetworking fixed the problem.