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

Initializr Network Issues #101

Open
belacyrf opened this issue Jan 15, 2019 · 9 comments
Open

Initializr Network Issues #101

belacyrf opened this issue Jan 15, 2019 · 9 comments
Assignees

Comments

@belacyrf
Copy link

As reported before here:
#84

I am having the same issue. I acknowledge this is not an extension bug, but I need to understand port / endpoints so I can request that the network paths are opened here at work.

First: VS Code is unable to fetch the avaliable Spring Versions as you can see here. It will sit and query forever without returning any versions.
springinit_error

Second: IF I use start.spring.io to create my project there and then try to open using visual studio code. I am unable to compile my Spring Boot project due to not being able to import the dependencies.

I was able to take my PC to a different network and download the dependencies, so things work now, but I will not be the first with this issue. Can you please provide the network credentials to the Spring.io sources that the extension uses? We can then request our company network firewall allows it.

Looking for [network path / ip] -- [port] -- [protocol] (ex: start.spring.io, 443, tcp) ??

Thanks

@Eskibear
Copy link
Member

To prevent hanging forever on version retrieving, I think maybe we can pop up an error message if timeout. So users are aware of what is happening.

To answer your questions:
The extension follows the Spring Initializr official API guide. So the host is start.spring.io (if you don't specify a custom one), and the port should be 443, protocol is https (and yes it's on top of tcp). The request is sent via NodeJS API https.get.

@belacyrf
Copy link
Author

belacyrf commented Jan 15, 2019

Thank you for this, can you provide any tips as to why ONLY visual studio code has an issue with this??

When I run the http get per the documentation you supplied using postman, I get the values

"bootVersion": {
"type": "single-select",
"default": "2.1.2.RELEASE",
"values": [
{
"id": "2.2.0.BUILD-SNAPSHOT",
"name": "2.2.0 (SNAPSHOT)"
},
{
"id": "2.1.3.BUILD-SNAPSHOT",
"name": "2.1.3 (SNAPSHOT)"
},
{
"id": "2.1.2.RELEASE",
"name": "2.1.2"
},
{
"id": "2.0.9.BUILD-SNAPSHOT",
"name": "2.0.9 (SNAPSHOT)"
},
{
"id": "2.0.8.RELEASE",
"name": "2.0.8"
},
{
"id": "1.5.20.BUILD-SNAPSHOT",
"name": "1.5.20 (SNAPSHOT)"
},
{
"id": "1.5.19.RELEASE",
"name": "1.5.19"
}
]
},

So using postman on my network works fine, using VSCode Extension fails. Any thoughts? Any methods of logging what is going on?

@Eskibear
Copy link
Member

Second: IF I use start.spring.io to create my project there and then try to open using visual studio code. I am unable to compile my Spring Boot project due to not being able to import the dependencies.

I assume you are behind a corporate proxy (correct me if not). Based on the facts that you:

  • succeed to get response from start.spring.io via postman. (indicating your system proxy is ok)
  • fail to access start.spring.io in vscode spring initializr extension. (this extension sends the request directly without any proxy settings, and I believe it won't use your system proxy)
  • fail to import dependencies in vscode. (If you mean the functionality provided by Language Support for Java, it actually launches java processes to do that, and I'm not sure whether your system proxy settings will be honored or not).

VSCode has setting entries to set proxy, but that won't affect the extensions, mentioned in the official docs below:

Extensions don't benefit yet from the same proxy support that VS Code supports.

Actually the extension proxy support is always a hot topic in VSCode. See microsoft/vscode#12588
Now as mentioned in microsoft/vscode#64202 , I think you can try the http.proxySupport config newly provided by VSCode. See if it work out.

image

@belacyrf
Copy link
Author

the thing is, my PC doesn't believe there is a proxy server.
proxy

So my Postman should be using the same network paths as VSCode. We definitely have web filters in place, but that should affect all of my applications the same way.

@Eskibear
Copy link
Member

@belacyrf

It will sit and query forever without returning any versions.

It has been identified as a bug that exceptions are not well-handled. Without the error message, it's hard to guess the root cause. The bug has been fixed along with other code changes, and in the next version (will be shipped in this week), you are able to see the error message. Let's see what happened then.

@Eskibear
Copy link
Member

v0.4.4 has been released, and you are supposed to see the error message now. I'm interested in the root cause, can you share the error message?

@Eskibear Eskibear self-assigned this Jan 22, 2019
@belacyrf
Copy link
Author

belacyrf commented Jan 22, 2019

sure.. give me a bit, I will update and re-test. Just FYI, some of the other issues I was seeing had to do with SSL Inspection (not proxy). I had to add certs to the cacerts java store in order to connect to some of the repositories I needed to connect to. Unfortunately this did not help the spring initilizr.

Changing the Spring Initializr from https://start.spring.io to use standard http, it works fine using http, but of course SSL would be preferred.

FYI.. I'll respond tomorrow.. working via VPN doesn't have the same SSL inspection as on net at the office.

@belacyrf
Copy link
Author

@Eskibear here is the error message:
Fail to create a project. Error: self signed certificate in certificate chain

This error is the same regardless of the vsCode proxy settings (SSL Strict true or false), (proxy support On or Override).

Also the certs have been added to the cacerts keystore for my java instance. As of now there is no work around other than to use http instead of https for the start.spring.io endpoint.

Thanks

@Eskibear
Copy link
Member

It looks an SSL cert issue now as you assumed. NodeJs https module doesn't honor your cacert java store.
Have you added the self-signed cert into your OS certificate store? (But I'm not 100% sure whether the OS cert store will be honored by the NodeJs.)

Back to the NodeJs, the NODE_EXTRA_CA_CERTS environment variable might help you out, you might give it a try. Launch VS Code with the env configured, see if it work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants