redhat-developer / redhat-developer/vscode-java
JDT.LS binary download does not honour VS Code http.proxy setting in corporate networks
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 2.3k
- Forks
- 546
- Ø Merge
- 20 Std. 1 Min.
- Gemergte PRs (30 T.)
- 11
Beschreibung
Problem
On first install (or when the extension downloads a JDT.LS update), the download fails silently in corporate environments that require an authenticated HTTPS proxy. VS Code exposes the proxy via http.proxy and http.proxyAuthorization settings, and also via HTTPS_PROXY / HTTP_PROXY environment variables injected into the extension host. However, the extension's download logic (in src/extension.ts and the download utility) does not read these and passes no proxy configuration to its HTTP client.
Steps to Reproduce
- In a corporate environment, set:
"http.proxy": "http://proxy.corp.example.com:8080", "http.proxyStrictSSL": false - Install the extension on a machine that has no prior JDT.LS installation.
- Open a Java file. The status bar shows "Downloading Java support..." indefinitely.
- No error appears; the Output → Java channel shows a TCP timeout to
download.jboss.orgor the GitHub releases CDN.
Expected Behaviour
The extension should detect the proxy from vscode.workspace.getConfiguration('http').get('proxy') or process.env.HTTPS_PROXY and configure its HTTP download agent accordingly (e.g., via https-proxy-agent or equivalent).
Workaround (not acceptable)
Users currently have to pre-download JDT.LS manually, which is not discoverable and breaks on updates.
Proposed Fix
import HttpsProxyAgent from 'https-proxy-agent';
const proxyUrl = vscode.workspace.getConfiguration('http').get<string>('proxy')
?? process.env.HTTPS_PROXY ?? process.env.HTTP_PROXY;
const agent = proxyUrl ? new HttpsProxyAgent(proxyUrl) : undefined;
// Pass agent to node-fetch / got / axios download client
Environment
- OS: Windows 11 Enterprise 10.0.26200 (mandatory corporate proxy, no direct internet)
- VS Code: 1.89+
- Extension: redhat.java latest
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginnen Sie in src/extension.ts und im Download-Dienstprogramm. Ermitteln Sie anschließend, welcher HTTP-Client die JDT.LS-Downloads verarbeitet und wie dessen Agent-Konfiguration übergeben wird. Prüfen Sie die im Issue beschriebenen VS Code-http-Einstellungen sowie die Eingaben über HTTPS_PROXY/HTTP_PROXY. Als erledigt gilt die Aufgabe, wenn Downloads einschließlich Updates über einen authentifizierten Proxy funktionieren, ohne das gemeldete stille Timeout.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- typescript, vscode
- Bereich
- devtools, networking
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Ruhig
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 55/100