fix(proxy): DefaultWebProxy mit angemeldeten Windows-Credentials (407 beheben)

Hinter dem Behoerden-Proxy scheiterte jeder Download (VERSION/MANIFEST/Bundles/
CHECKSUMS) mit '(407) Proxyauthentifizierung erforderlich', sobald update.ps1
von update.bat per Invoke-Expression geladen und ausgefuehrt wurde. Loesung:
einmalig oben (nach $DistBase, vor dem ersten Invoke-WebRequest) dem System-
Proxy die DefaultNetworkCredentials (Negotiate/NTLM des laufenden Benutzers)
mitgeben -> wirkt global fuer alle folgenden Requests.

Spiegelt den gleichen Fix in VI3 server.ps1 (Update-Check). Damit funktioniert
auch der In-App-'Installieren'-Button (server.ps1 startet update.bat -> update.ps1).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Rhino
2026-06-21 20:38:31 +02:00
co-authored by Claude Opus 4.8
parent b26c0c0ebc
commit 27a265b101
+13
View File
@@ -11,6 +11,19 @@
$ErrorActionPreference = 'Stop' $ErrorActionPreference = 'Stop'
$DistBase = "https://updates.rhino.nrw/rhino/StatusQuo_Updates/raw/branch/main/$proj" $DistBase = "https://updates.rhino.nrw/rhino/StatusQuo_Updates/raw/branch/main/$proj"
# Behoerden-Proxy verlangt Authentifizierung (407) -> dem System-Proxy einmalig
# die angemeldeten Windows-Credentials (Negotiate/NTLM des laufenden Benutzers)
# mitgeben, sonst scheitert JEDER Download (VERSION/MANIFEST/Bundles/CHECKSUMS)
# unten mit '(407) Proxyauthentifizierung erforderlich'. Wirkt global ueber
# DefaultWebProxy fuer alle folgenden Invoke-WebRequest-Aufrufe.
try {
$p = [System.Net.WebRequest]::GetSystemWebProxy()
if ($p) {
$p.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials
[System.Net.WebRequest]::DefaultWebProxy = $p
}
} catch {}
$_stopName = if ($null -ne $stopBat) { $stopBat } else { 'stop.bat' } $_stopName = if ($null -ne $stopBat) { $stopBat } else { 'stop.bat' }
$_startName = if ($null -ne $startBat) { $startBat } else { 'dgl.bat' } $_startName = if ($null -ne $startBat) { $startBat } else { 'dgl.bat' }