jfrog / jfrog-idea-plugin

JFrog IntelliJ IDEA plugin
https://jfrog.github.io/jfrog-idea-plugin/
Apache License 2.0
196 stars 31 forks source link

"Could not connect to Xray: Connection refused: connect" behind corporate firewall #73

Closed seanf closed 3 years ago

seanf commented 4 years ago

Describe the bug Plugin can't connect to Xray.

To Reproduce

  1. Configure Xray URL, username (email) and API key (from Artifactory profile page)
  2. Click "Test connection"

Expected behaviour Expected a successful connection to Xray, but got the error message "Could not connect to Xray: Connection refused: connect"

Screenshots image image

Versions

Additional context

seanf commented 4 years ago

It works if I use manual proxy settings; it's just the auto proxy configuration which the plugin can't handle:

image

(I also had to switch from email address to domain user name to avoid a 401.)

seanf commented 4 years ago

It looks like the code assumes that there is a single proxy host/port regardless of URL, which I understand isn't true in general with PAC files:

https://github.com/jfrog/jfrog-idea-plugin/blob/5458664b6453efaa6009dd3db14206d065d14785/src/main/java/com/jfrog/ide/idea/configuration/XrayServerConfigImpl.java#L170-L183

yahavi commented 4 years ago

Thanks for reporting this issue, @seanf! We appreciate your help on finding the root cause of the problem in the code.

We love code contribution from the community. Would you like to help us to fix this issue quickly by contributing a fix in a pull request? You can find in the README all necessary steps on how to develop the plugin code.

yahavi commented 3 years ago

@seanf, JFrog IDEA plugin 1.7.0 is released. This versions includes support for providing PAC files from Intellij IDEA configuration. As usual, you can define Auto-detect proxy settings as instructed here: https://www.jetbrains.com/help/idea/settings-http-proxy.html. We'll appreciate your feedback for that.

seanf commented 3 years ago

Yes, it's now working both with manual and auto-detect proxy settings. Thanks!