dynatrace-extensions / dynatrace-extensions-vscode

A VisualStudio Code extension to support all aspects of developing Dynatrace Extensions 2.0
Apache License 2.0
16 stars 7 forks source link

[Bug]: Connect to a Dynatrace env using company's proxy #220

Closed ydas1lva closed 4 months ago

ydas1lva commented 4 months ago

Description

Hi, I am trying to configure this extension, and I'm having trouble adding a Dynatrace environment: 2024-05-13T14:16:44.564Z [ERROR][utils.conditionCheckers.checkUrlReachable] Request failed with status code 407 2024-05-13T14:16:44.565Z [ERROR][treeViews.commands.environments.addEnvironment] The environment URL entered is not reachable. error_code

In fact, in my company we're using a proxy server and it looks like this extension doesn't use the "http.proxy" vscode setting nor my OS env variables (HTTP_PROXY or HTTPS_PROXY).

What do you think? Am I missing smth ? Thanks,

Steps to reproduce

  1. Click "Add environment" in the "ENVIRONMENTS" section.
  2. Enter the URL.

Support information

radu-stefan-dt commented 4 months ago

Hi, please try using the dedicated VSCode settings for proxy configuration (as documented here):

http.proxy
http.proxyStrictSSL
http.proxyAuthorization

If these end up not working I will transfer this bug to an RFE for adding proxy support in our extension.

ydas1lva commented 4 months ago

Hi Radu,

I tried with the following:

"http.proxy": "http://USER:PASSWORD@PROXY_URL:PORT",
"http.proxyAuthorization": null,
"http.proxyStrictSSL": false

It doesn't work.

Same result with OS environment variables HTTP_PROXY and HTTPS_PROXY.

Yes, you can transfer this as an RFE.

Thank you.

ydas1lva commented 4 months ago

Hi Radu,

Update: actually, the extension correctly uses the http_proxy, https_proxy and no_proxy env variables. My problem, connecting to our Dynatrace Managed is elsewhere since the command "dt-sdk upload ..." returns [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain The axios 'Request failed with status code 407' was not that verbose.

So, the extension correctly uses proxy settings when setting the proxy's env variables.

Thank you.

Regards,

radu-stefan-dt commented 4 months ago

@ydas1lva from the extension we don't use dt-sdk for the upload. It would be the same axios client that's used when you first register your tenant.

Try using our settings for uploading a custom CA or disabling SSL. These are documented here