Skip to content

Conversation

@stoty
Copy link
Contributor

@stoty stoty commented Oct 20, 2025

Work in progress
Needs JDK 25 installed and configured in maven toolchains

Run

mvn clean verify -Pdocker -Drat.skip -Dcheckstyle.skip -Dit.test=ApacheHTTPDSquidCompatibilityIT\* -Dsurefire.failIfNoSpecifiedTests=false -Dtest=foo

to demonstrate the problem.
The test fails when running the test with Java 25, but passes with 17.

@ok2c
Copy link
Member

ok2c commented Nov 4, 2025

@stoty Is this how the problem manifests itself?

[ERROR] Tests run: 6, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.076 s <<< FAILURE! -- in org.apache.hc.client5.testing.compatibility.ApacheHTTPDSquidCompatibilityIT$AsyncDirectHttp1SpnegoDoAs
[ERROR] org.apache.hc.client5.testing.compatibility.ApacheHTTPDSquidCompatibilityIT$AsyncDirectHttp1SpnegoDoAs.test_auth_success -- Time elapsed: 0.013 s <<< FAILURE!
org.opentest4j.AssertionFailedError: expected: <200> but was: <401>
	at org.apache.hc.client5.testing.compatibility.async.HttpAsyncClientCompatibilityTest.lambda$test_auth_success$3(HttpAsyncClientCompatibilityTest.java:268)
	at java.base/jdk.internal.vm.ScopedValueContainer.callWithoutScope(ScopedValueContainer.java:162)
	at java.base/jdk.internal.vm.ScopedValueContainer.call(ScopedValueContainer.java:147)
	at java.base/java.lang.ScopedValue$Carrier.call(ScopedValue.java:419)
	at java.base/javax.security.auth.Subject.callAs(Subject.java:331)
	at org.apache.hc.client5.testing.util.SecurityUtils.callAs(SecurityUtils.java:191)
	at org.apache.hc.client5.testing.compatibility.async.HttpAsyncClientCompatibilityTest.test_auth_success(HttpAsyncClientCompatibilityTest.java:258)
	at java.base/java.lang.reflect.Method.invoke(Method.java:565)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1604)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1604)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1604)

@stoty
Copy link
Contributor Author

stoty commented Nov 4, 2025

Yes, @ok2c .

@stoty
Copy link
Contributor Author

stoty commented Nov 4, 2025

AsyncDirectHttp1Spnego still succeeds, because it doesn't rely on getting the Subject from the Thread JAAS Scope.

So SPNEGO in general still works with Async as long the Principal is explicitly set.

@stoty stoty marked this pull request as draft November 4, 2025 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants