Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weird behaviour / not working with a proxy #97

Open
jbackes opened this issue Feb 17, 2021 · 7 comments
Open

Weird behaviour / not working with a proxy #97

jbackes opened this issue Feb 17, 2021 · 7 comments
Labels
bug Something isn't working

Comments

@jbackes
Copy link

jbackes commented Feb 17, 2021

Describe the bug
We have an X-Ray server only reachable over a proxy server; lets say X-Ray server is https://xray and proxy is http://proxy:6789; note that proxy is http and X-Ray is https. I set the proxy in vscode and this seems to be working perfectly fine, i.e. I can install plugins, update vscode and wireshark for example logs from my ip to proxy ip: CONNECT update.code.visualstudio.com:443 HTTP/1.1 which succeeds with "Connection Established" etc.
But after entering the X-Ray configuration, the status bar just says "Checking connection with Xray server..." for about maybe 10 minutes and then an alert window pops up saying "Socket hang up".
Wireshark logs something weird (at least in my opinion): There is no CONNECT to the proxy but an http POST to the proxy with request url https://xray/api/v1/summary/component. In my opinion, wireshark should not see this POST because the connection should be ssl/tls encrypted but it seems like the plugin never tries to establish an ssl connection.

To Reproduce
Try to configure an https xray over an http proxy

Expected behavior
A successful connection to xray

Versions

  • JFrog VS-Code extension version: 1.6.0
  • JFrog VS-Code extension operating system: Windows 10 19042.746
  • JFrog Xray Version: 2.7.6
@jbackes jbackes added the bug Something isn't working label Feb 17, 2021
@PiyushJonnie
Copy link

Steps to reproduce the issue :

  • Install latest VSCode
  • Install latest version of JFrog VSCode plugin
  • Connect the plugin to Artifactory
  • Enter JFrog platform URL
  • Accept proposed Artifactory URL
  • Accept proposed Xray URL
  • Enter JFrog access token
  • Wait for the connection to establish

Visual Studio Code error message window appears with text: “Request failed with status code 400”

@eyalbe4
Copy link
Contributor

eyalbe4 commented Feb 5, 2022

Thank you for reporting this issue @PiyushJonnie!
Is you JFrog environment accessible through an HTTP proxy?
If so, ddi you set your proxy details as described here?

@PiyushJonnie
Copy link

@eyalbe4 Yes, here JFrog environment is only accessible through an HTTP proxy. Proxy settings are configured as mentioned in the link. If the proxy is disabled, the response changes to:

“Could not connect to Xray: Error connect ETIMEDOUT :443”

Other extensions are working correctly and are able to use the proxy as expected.

@jghal
Copy link

jghal commented Mar 9, 2023

I am seeing the similar issue, except I can make it all the way through the configuration prompts including my Artifactory credentials, and then it's a few seconds until the error pops up.

I tried setting jfrog.logLevel to debug but I don't know where that log is to check it.

VS Code version

Version: 1.76.1 (user setup)
Commit: 5e805b79fcb6ba4c2d23712967df89a089da575b
Date: 2023-03-08T16:32:00.131Z
Electron: 19.1.11
Chromium: 102.0.5005.196
Node.js: 16.14.2
V8: 10.2.154.26-electron.0
OS: Windows_NT x64 10.0.19044
Sandboxed: Yes

Extension version

Name: JFrog
Id: JFrog.jfrog-vscode-extension
Description: JFrog Xray scanning of Go, npm, Pypi, Maven and NuGet project dependencies.
Version: 2.0.2
Publisher: JFrog
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=JFrog.jfrog-vscode-extension

@jghal
Copy link

jghal commented Mar 9, 2023

And just to confirm the negative, I am able to connect the extension to this same [public-facing] Artifactory server when off the corporate network and not using a proxy.

@jghal
Copy link

jghal commented Mar 10, 2023

Additionally. Both jfrog and frogbot can connect to the Artifactory server with the proxy with http[s]_proxy env variables set. I've tried with and without proxy authentication configured, though I don't actually need to authenticate the proxy for this server (confirmed with jfrog and curl). When I set the extension log level to debug, I don't see any extra info in the extension logs versus info logging.

@attiasas
Copy link
Contributor

attiasas commented May 4, 2023

Our apologies for the inconvenience caused by this.
This PR - jfrog-client-js/pull/73 should fix it.
Fix released from version 2.2.0+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants