You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 1a3ccd8
Browse filesBrowse the repository at this point in the historyBrowse files
.Net: Bind validated HTTP addresses to connections (#14719)
### Motivation and Context
<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
1. Why is this change required?
2. What problem does it solve?
3. What scenario does it contribute to?
4. If it fixes an open issue, please link to the issue here.
-->
`HttpPlugin` validated resolved addresses before sending a request, but
the built-in HTTP transport did not retain that address set when opening
the connection. This change keeps the validation decision and the
resulting connection consistent.
### Description
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
- Moves the existing validated-address connection handling into the
shared internal HTTP client provider.
- Passes the addresses validated by `HttpPlugin` to the built-in
transport while preserving the original HTTP and TLS hostname.
- Keeps validated and explicitly unchecked requests in separate
connection pools.
- Fails closed for hostname requests when a caller-supplied client or
target framework cannot guarantee address binding.
- Adds deterministic request projection, connection, and custom-client
regression coverage.
Validation:
- `dotnet build dotnet\src\Plugins\Plugins.Core\Plugins.Core.csproj -c
Debug --tl:off --warnaserror --no-restore` — passed for `net10.0`,
`net8.0`, and `netstandard2.0` with no warnings.
- `dotnet build
dotnet\src\Functions\Functions.OpenApi\Functions.OpenApi.csproj -c Debug
--tl:off --warnaserror --no-restore` — passed for `net10.0`, `net8.0`,
and `netstandard2.0` with no warnings.
- `dotnet build
dotnet\src\Plugins\Plugins.UnitTests\Plugins.UnitTests.csproj -f net10.0
-c Debug --tl:off --warnaserror --no-restore` — passed with no warnings.
- `dotnet build
dotnet\src\Functions\Functions.UnitTests\Functions.UnitTests.csproj -f
net10.0 -c Debug --tl:off --warnaserror --no-restore` — passed with no
warnings.
- `dotnet test
dotnet\src\Plugins\Plugins.UnitTests\Plugins.UnitTests.csproj -f net10.0
-c Debug --no-restore -v Normal --logger trx` — passed: 583 passed, 15
environment-specific skips, 0 failed.
- `dotnet test
dotnet\src\Functions\Functions.UnitTests\Functions.UnitTests.csproj -f
net10.0 -c Debug --no-restore --filter
FullyQualifiedName~OpenApiHttpClientProviderTests -v Normal --logger
trx` — passed: 11 passed, 0 failed.
- Container-based `dotnet format --verify-no-changes` for the affected
projects — passed.
### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [x] The code builds clean without any errors or warnings
- [x] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [x] All unit tests pass, and I have added new tests where possible
- [x] I didn't break anyone 😄
/// Connects directly to an address validated for the request, preventing a second DNS lookup from selecting a different destination.
106
-
/// </summary>
107
-
/// <remarks>
108
-
/// For example, <c>https://api.example.com</c> can connect to validated address <c>93.184.216.34</c>
109
-
/// while retaining the hostname for TLS and HTTP. Proxy destinations are left unchanged because the proxy owns DNS resolution.
110
-
/// Address attempts overlap after a short delay, keeping slow routes viable until another address connects.
0 commit comments