Skip to content

Internet connectivity issue: Could not establish connection with WalledGardenStrategy #464

Description

@mirwisek

Internet connected state is misleading
I added the library to my projects and I'm only observing internet connectivity. It is always returning false even when my wifi is working fine. To confirm that, I observed network state and it is returning CONNECTED while internet connectivity is showing false.

To Reproduce
Steps to reproduce the behavior:

  1. I just tested the Kotlin sample nothing fancy

Expected behavior
It should show that internet is connected while Network state is CONNECTED

Screenshots
If applicable, add screenshots to help explain your problem.

Smartphone:

  • Device: Xaiomi Pocco F3
  • OS: Android 12
  • Library Version: v3.0.8-rx2

Error

I'm continuously getting the following error after each 2 seconds. It seems the library is pinging a URL that is http (Not permitted).

E/ReactiveNetwork: Could not establish connection with WalledGardenStrategy
    java.io.IOException: Cleartext HTTP traffic to clients3.google.com not permitted
        at com.android.okhttp.HttpHandler$CleartextURLFilter.checkURLPermitted(HttpHandler.java:127)
        at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:462)
        at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:411)
        at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:542)
        at com.github.pwittchen.reactivenetwork.library.rx2.internet.observing.strategy.WalledGardenInternetObservingStrategy.isConnected(WalledGardenInternetObservingStrategy.java:109)
        at com.github.pwittchen.reactivenetwork.library.rx2.internet.observing.strategy.WalledGardenInternetObservingStrategy$1.apply(WalledGardenInternetObservingStrategy.java:66)
        at com.github.pwittchen.reactivenetwork.library.rx2.internet.observing.strategy.WalledGardenInternetObservingStrategy$1.apply(WalledGardenInternetObservingStrategy.java:64)
        at io.reactivex.internal.operators.observable.ObservableMap$MapObserver.onNext(ObservableMap.java:57)
        at io.reactivex.internal.operators.observable.ObservableInterval$IntervalObserver.run(ObservableInterval.java:82)
        at io.reactivex.Scheduler$PeriodicDirectTask.run(Scheduler.java:532)
        at io.reactivex.Scheduler$Worker$PeriodicTask.run(Scheduler.java:479)
        at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66)
        at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:920)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions