jenius-apps / nightingale-rest-api-client

A modern, resource-efficient REST API client for Windows
https://nightingale.rest
MIT License
769 stars 36 forks source link

Can not connect to REST services on local network and domain-joined hosts #11

Closed azunyuuuuuuu closed 5 years ago

azunyuuuuuuu commented 5 years ago

When trying to call a REST service residing on the local or domain-joined network I get the following error message:

An error occurred while sending the request. The text associated with this error code could not be found.

A connection with the server could not be established

Using the command checknetisolation debug -p=S-1-15-2-2472482401-1297737560-3464812208-2778208509-1273584065-1826830168-474783446 I was able to get the following output which basically states that the capabilities for PrivateNetworkClientServer are not enabled in the .appxmanifest file:

C:\WINDOWS\system32> checknetisolation debug -p=S-1-15-2-2472482401-1297737560-3464812208-2778208509-1273584065-1826830168-474783446

Network Isolation Debug Session started.
Reproduce your scenario, then press Ctrl-C when done.
      Collecting Logs.....

Summary Report

Network Capabilities Status
----------------------------------------------------------------------
    InternetClient                Not Used and Insecure
    PrivateNetworkClientServer    Missing, maybe intended

Detailed Traffic Report
----------------------------------------------------------------------

    InternetClient                Not Used and Insecure

 ------------------------------------------------------------------

    PrivateNetworkClientServer    Missing, maybe intended

 ------------------------------------------------------------------
      <ip address of host>

OK.

Please enable this capability for us to be able to call REST services on the local network.

dpaulino commented 5 years ago

Hi @azunyuuuuuuu thanks for reaching out.

Nightingale should be capable of connecting to your localhost on the same machine. Have you tried turning this off in the settings menu?

image

dpaulino commented 5 years ago

Also, regarding domain-joined hosts, yes that's a known issue. I have an upcoming update to add the PrivateNetworkClientServer capability to the app manifest. I'll ping this issue again once that update is live, and I will ask you at that time to check if the issue was fixed.

azunyuuuuuuu commented 5 years ago

Hi @azunyuuuuuuu thanks for reaching out.

Nightingale should be capable of connecting to your localhost on the same machine. Have you tried turning this off in the settings menu?

image

This was the first thing I tried, as I suspected it is the ssl certificate. It didn't work :( But querying REST interfaces outside of the local network worked fine with this activated and deactivated.

Also, regarding domain-joined hosts, yes that's a known issue. I have an upcoming update to add the PrivateNetworkClientServer capability to the app manifest. I'll ping this issue again once that update is live, and I will ask you at that time to check if the issue was fixed.

Thank you very much. I`ll be waiting until then.

Edit: I also found this while researching this bug: https://github.com/microsoft/testfx/pull/476/commits/26d82caae101eef1a1728597dbc16b449be13cf8#diff-d9ff8be6d8da869ef024d763664ccfc5R43

This commit shows where to put the capability.

dpaulino commented 5 years ago

An update is coming in a few days to the preview program. Any chance you're interested in joining? The fix will be included in there. If you're interested, feel free to sign up here https://forms.office.com/Pages/ResponsePage.aspx?id=DQSIkWdsW0yxEjajBLZtrQAAAAAAAAAAAANAAQduPxpURU8zSUFNUTBYRDVSUkhJS0JQOE8yTFZYTy4u

azunyuuuuuuu commented 5 years ago

I have signed up for the preview program and will try it as soon as the preview is available.

dpaulino commented 5 years ago

The newest preview build just went live with the PrivateNetworkClientServer capability included. The version of the preview build is 3.0.2. Please let me know if that fixes your issue.

azunyuuuuuuu commented 5 years ago

The newest release fixes this flawlessly. Tyvm :)

dpaulino commented 5 years ago

Thanks for confirming!

rasmusfjord commented 4 years ago

So im still getting this issue :( On localhost: An error occurred while sending the request

Have tried the SSL switch off but still getting this. Isnt this released yet?

zippoxer commented 4 years ago

Getting this problem as well.

cherepets commented 4 years ago

Still getting same error

delzac commented 4 years ago

Hi, i'm also getting exceptions when connecting to localhost.


An error occurred while sending the request.
   at System.Net.Http.HttpClientHandler.<SendAsync>d__113.MoveNext() + 0x361
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0x70
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotificati
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x17
   at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__62.MoveNext() + 0x316
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0x70
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotificati
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x17
   at Nightingale.Core.Client.NightingaleClient.<SendAsync>d__6.MoveNext() + 0x26c
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0x70
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotificati
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x17
   at Nightingale.Core.Services.RequestSender.<SendRequestAsync>d__5.MoveNext() + 0x14e
dpaulino commented 4 years ago

Have you tried the instructions here? https://github.com/jenius-apps/nightingale-rest-api-client/blob/master/docs/localhost.md

dpaulino commented 4 years ago

image

delzac commented 4 years ago

@dpaulino Hi, thanks for the suggestion, i just tried it, didn't work. Don't know why. But its okay, i can live with that. No big deal.

Thank for creating the app too, its really great to use :)

dpaulino commented 4 years ago

What does your localhost url look like? And just to double check, you tried turning off ssl validation in Nightingale's settings?

delzac commented 4 years ago

Yup, i switched off SSL validation and it still didn't work. Restart my computer too.

The url i used was http://localhost/gec/?text=Hi i also tried http://127.0.0.1/gec/?text=Hi didn't work too.

image

dpaulino commented 4 years ago

@delzac what's running on your localhost? An ASP.NET Core app?

delzac commented 4 years ago

Hi @dpaulino, i'm running Python 3.6 on Uvicorn with FastAPI.

Thanks for taking the time out to maintain this :)

dpaulino commented 4 years ago

@delzac no problem! Any chance you can set up a github repo that is configured the same way as your python project with a quick readme on how to run it on local host? I'd like to try to reproduce this.

delzac commented 4 years ago

@dpaulino sure thing! Would a docker image be better or do you prefer the github repo with instructions?

dpaulino commented 4 years ago

@delzac github repo with instructions would be best. Thanks in advance

delzac commented 4 years ago

@dpaulino Okay! I'll get back to you here again once its up :)

dpaulino commented 4 years ago

@delzac whenever you're ready, can you share your repo link using a new issue? It will be easier to track investigations on your specific scenario in a new issue

delzac commented 4 years ago

Hi @dpaulino I double checked and realised that the worldaround works! I so so so sorry for taking up your time.

The issue was that i didn't add the port 8000 into the url. LOL. With http://localhost:8000/ everything worked fine.

Once again, thank you for taking the time out to help and create this app. :)

rodrigo-sobral commented 3 years ago

Hi @dpaulino! Firstly congratz for your awesome app, it is exactly what I was needing. However, I'm having the same issue. I've already done everything that was said here and still not working. To give you some context, I'm running a NodeJS web server and I also tried with REST Client extension on VSCode and it worked. The point is that I don't actually want to use it, you app is faraway more organized.

image

image

Thank you in advance! 😃

dpaulino commented 3 years ago

@RodrigoSobral2000 Have you tried this troubleshoot guide? https://github.com/jenius-apps/nightingale-rest-api-client/blob/master/docs/localhost.md

rodrigo-sobral commented 3 years ago

I'm sorry for bothering you. I actually didn't have seen that file. It worked just fine. Thank you once again, keep up with the good work! 😃 👍🏻