redhat-developer / redhat-developer/vscode-java

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

Ouverte
#4,452 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Langage dominant
TypeScript
Étoiles
2.3k
Forks
546
Merge moyen
20 h 1 min
PR mergées (30 j)
11

Description

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

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez dans src/extension.ts et dans l’utilitaire de téléchargement, puis identifiez quel client HTTP gère les téléchargements de JDT.LS et comment sa configuration d’agent est transmise. Vérifiez les paramètres http de VS Code et les entrées HTTPS_PROXY/HTTP_PROXY décrits dans l’issue. Le travail est terminé lorsque les téléchargements fonctionnent via un proxy authentifié, y compris les mises à jour, sans le délai d’attente silencieux signalé.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
typescript, vscode
Domaine
devtools, networking
Type d'issue
Bug
Difficulté
3/5
Temps estimé
1-2 jours
Activité
Calme
Clarté
Plutôt claire
Accessibilité débutants
55/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.