redhat-developer / redhat-developer/vscode-java

JDT.LS binary download does not honour VS Code http.proxy setting in corporate networks

Aperta
#4,452 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
TypeScript
Stelle
2.3k
Fork
546
Merge medio
20h 1m
PR unite (30g)
11

Descrizione

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

  1. In a corporate environment, set:
    "http.proxy": "http://proxy.corp.example.com:8080",
    "http.proxyStrictSSL": false
    
  2. Install the extension on a machine that has no prior JDT.LS installation.
  3. Open a Java file. The status bar shows "Downloading Java support..." indefinitely.
  4. No error appears; the Output → Java channel shows a TCP timeout to download.jboss.org or 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

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia da src/extension.ts e dall’utilità di download, quindi individua quale client HTTP gestisce i download di JDT.LS e come viene passata la sua configurazione dell’agent. Controlla le impostazioni http di VS Code e gli input HTTPS_PROXY/HTTP_PROXY descritti nell’issue. Il lavoro è completato quando i download funzionano tramite un proxy autenticato, inclusi gli aggiornamenti, senza il timeout silenzioso segnalato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
typescript, vscode
Ambito
devtools, networking
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
55/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.