Test-WebConnection fails in proxy-only WinPE environments due to direct TCP precheck

オープン
#399 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
powershell
領域
networking

調査の方向性

Read the current and older Test-WebConnection implementations linked in the issue, especially the ConnectAsync call and the TCP failure path that skips Invoke-WebRequest. Reproduce the described WinPE proxy case with the provided PowerShell request and inspect how proxy settings reach the web request. Done when the function can test through a proxy without a direct destination TCP precheck, while retaining the expected behavior for direct connections.

索引モデルが issue の本文から書いたものです。

説明

Describe the bug

In OSD 26.10.16.1, Test-WebConnection requires a direct TCP connection to the destination before running Invoke-WebRequest.

In a WinPE deployment environment where internet access is only permitted through an HTTP proxy, direct connections to the destination are blocked. The TCP precheck therefore fails and skips the HTTP request entirely, even when the destination is accessible through the proxy.

The function currently provides no explicit proxy parameter or option to skip this direct TCP precheck.

This report is based on source-code inspection. Runtime logs from the affected WinPE environment are not yet attached.

To Reproduce

  1. Boot into WinPE on a network where internet access requires an HTTP proxy and direct outbound connections are blocked.

  2. Load OSD version 26.10.16.1.

  3. Verify that an HTTP HEAD request succeeds through the proxy, using an allowed destination and the actual proxy address:

    Invoke-WebRequest `
        -Uri 'https://www.google.com' `
        -Method Head `
        -Proxy 'http://proxy.example.com:8080' `
        -UseBasicParsing `
        -ErrorAction Stop
    

    This example assumes the proxy permits access from WinPE without interactive user authentication.

  4. Run:

    Test-WebConnection -Uri 'https://www.google.com' -Verbose
    
  5. The current code takes the TCP failure path, reports Test-WebConnection TCP FAIL, and returns $false without attempting Invoke-WebRequest.

Expected behavior

Test-WebConnection should support testing connectivity through a proxy without requiring a direct TCP connection to the destination.

A possible solution would be to:

  • Add a -Proxy parameter and forward it to Invoke-WebRequest.
  • Skip the direct destination TCP precheck when an explicit proxy is used.
  • Provide an option to skip the direct TCP precheck when the web request already has a working proxy configuration.

Screenshots

Not available. Runtime logs have not yet been attached.

Desktop (please complete the following information):

  • OS: Windows PE (WinPE), deployment phase
  • Browser: Not applicable
  • Version: OSD 26.10.16.1
  • Exact WinPE build and PowerShell version: Not yet provided

Smartphone (please complete the following information):

Not applicable.

Additional context

Compared versions:

The older implementation called Invoke-WebRequest directly without requiring a separate direct TCP connection.

The new implementation calls:

$ConnectTask = $TcpClient.ConnectAsync(
    $RequestUri.DnsSafeHost,
    $RequestPort
)

If this connection fails, the catch block executes continue, preventing the subsequent HTTP request from using a proxy.

In WinPE, integrated proxy authentication using an interactive domain user's credentials cannot be assumed to be available.

主要言語
PowerShell
スター
251
フォーク
102
平均マージ
2分
マージ済み PR(30日)
4

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

OSDeploy/OSD のほかの issue

OSDeploy/OSD の issue をすべて見る

似ている issue

Networking の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。