AnWeber / vscode-httpyac

Quickly and easily send REST, Soap, GraphQL, GRPC, MQTT and WebSocket requests directly within Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=anweber.vscode-httpyac
MIT License
222 stars 20 forks source link

VSCode: The requested URL could not be retrieved #227

Closed QuAzI closed 9 months ago

QuAzI commented 9 months ago

I have http script which works fine in JB apps and in console

httpYac send .\migration-script.http -e development -n Login --insecure

But from VSCode it always return 500 with comment The requested URL could not be retrieved

migration-script.http

### Login
POST https://{{host}}/app/identity/api/login
Content-Type: application/json

{"email":"{{username}}","password":"{{password}}","rememberme":true,"nextPage":""}

> {%
    client.test("Authorization tests", function() {
      client.assert(response.status === 200, "Response status is not 200");
      client.assert(response.body.hasOwnProperty("success"), "Cannot find 'success' option in response");
      client.assert(response.body["success"] == true, `Status is ${response.body["success"]}`);
    });
    client.global.set("userId", response.body["userID"]);
%}

http-client.private.env.json

{
    "development": {
        "host": "local.somesite",
        "username": "login@mail",
        "password": "pass"
    }
}
AnWeber commented 9 months ago

@QuAzI I cannot understand the error. I am trying to recreate the setup.

Observed: It uses correct environment

setup

QuAzI commented 9 months ago

It looks like connected to the local self-signed certificate for microservice in Docker. Because the same request for public version works fine. In CLI version I used --insecure parameter and it works but it's not so comfortable in development. But I don't know how to use the same option in VSCode or how to pass self-signed certificate from local Cert Manager to VSCode plugins. JB tool and my own .NET project works fine with this certificate.

AnWeber commented 9 months ago

look at docs: https://httpyac.github.io/guide/troubleshooting.html#turn-off-verification-of-self-signed-certificate

It is a NodeJS issue which provides its own cert store. Maybe using win-ca extension also solves your problem. Or just disable as mentioned in docs.

QuAzI commented 9 months ago

Thanks a lot, I found the reason. It was my fault - I forgot about proxy settings in VSCode