Forum Xamarin Xamarin.Android

System.Net.WebEception Error: ConnectFailure(Connection refused)

EmanEman USMember ✭✭

Hi All,

We are having issue Connection refused exception when calling a secured web api in our mobile app, we are using mobile VPN to connect to this and using actual device for testing.

But if we use the public API we have, it is working. (same code, just different environment, no vpn running)

And if I used Advanced Rest client in desktop to call the api with VPN running it is also working.
I also tried to install httper app in the actual phone to call the api with VPN running, it also worked.

your help will be greatly appreciated..



  • JasonixDevJasonixDev Member ✭✭
    edited August 2019

    Edit your MainActivity.cs

    with the line: ServicePointManager.ServerCertificateValidationCallback += (o, certificate, chain, errors) => true;

Sign In or Register to comment.