Enable JVM proxy system properties in Key Vault JCA HTTP client#49316
Enable JVM proxy system properties in Key Vault JCA HTTP client#49316waiet wants to merge 3 commits into
Conversation
|
Thank you for your contribution @waiet! We will review the pull request and get back to you soon. |
|
@microsoft-github-policy-service agree company="IThink s. r. o." |
ea872c2 to
fda1379
Compare
670a55e to
310200d
Compare
|
Hi @moarychan , this PR adds support for standard JVM proxy system properties in the azure-security-keyvault-jca internal Apache HttpClient, The PR is ready for review when you have a chance. Thank you! |
dfdc8f1 to
cc98829
Compare
|
This change would be very helpful also for us. This is exactly what we need. We have tried the same change and had it our test environments for while now. Works well. |
4efd3b3 to
aeb113b
Compare
aeb113b to
46a4f38
Compare
It would be great, if this feature will be released in next version. But the PR is still waiting for review :-( |
Problem
Fixes #28801.
The Key Vault JCA provider uses an internal Apache HttpClient in
HttpUtilinstead of the standard Azure SDK HTTP pipeline. As a result, standard JVM proxy properties such ashttps.proxyHost,https.proxyPort,http.proxyHost,http.proxyPort, andhttp.nonProxyHostswere not honored when the provider was used behind a corporate proxy.Solution
Configure the internal Apache HttpClient builder with
useSystemProperties()while preserving the existing SSL/truststore connection manager behavior.This PR also adds unit-level proxy coverage and documents a
jarsignerproxy example using standard JVM system properties.Testing
Added a unit test that sets
http.proxyHostandhttp.proxyPort, serves a local proxy response, and verifiesHttpUtil.getroutes through the proxy. The test locks JVM system properties while it runs to avoid interference with parallel JUnit execution.Validated with module-level tests:
mvn -f sdk/keyvault/azure-security-keyvault-jca/pom.xml -DskipITs -Dgpg.skip -Dspotbugs.skip -Drevapi.skip -Dspotless.skip=true -Dcodesnippet.skip=true -Djacoco.skip=true -DheapDumpOnOom= testResult: 80 tests, 0 failures, 0 errors, 29 skipped.
The root
mvn -pl sdk/keyvault/azure-security-keyvault-jca -DskipITs -Dgpg.skip -Dspotbugs.skip -Drevapi.skip testcommand could not run in this sparse checkout because the root POM references modules not present locally.