apache / apache/jmeter

SPNEGO always canonicalizes host names, Option to pick behavior would be welcome

Open
#4,268 4 comments 0 reactions 0 assignees View on GitHub
need info os: macOS P2
Dominant language
Java
Stars
9.5k
Forks
2.3k
Avg merge
1d 22h
Merged PRs (30d)
5

Description

**Zoltan Farkas** ([Bug 60696](https://bz.apache.org/bugzilla//show_bug.cgi?id=60696&redirect=false)):
At:

https://github.com/apache/jmeter/blob/c616f4f84d11812febbf442806b90b02c306fe0c/src/protocol/http/org/apache/jmeter/protocol/http/control/AuthManager.java#L474

SPNegoSchemeFactory is created like:

new SPNegoSchemeFactory(isStripPort(url)));

the scheme factory has an alternate constructor (https://github.com/apache/httpclient/blob/4.5.x/httpclient/src/main/java/org/apache/http/impl/auth/SPNegoSchemeFactory.java#L53) that allows to pick canonicalization behavior for the host name:

/**
* @since 4.4
*/
public SPNegoSchemeFactory(final boolean stripPort, final boolean useCanonicalHostname) {

Unfortunately for certain use cases where we have a load balancer serving multiple names mapped to the same IP address the canonicalization breaks authentication for us by generating a incorrect SPN.

It would be helpful to be able to control this behavior in JMeter either via UI or config.

Severity: normal
OS: Mac OS X 10.1

Contributor guide

Open the contributing guide

Research direction

Start in src/protocol/http/org/apache/jmeter/protocol/http/control/AuthManager.java around line 474 and compare the available SPNegoSchemeFactory constructors in Apache HttpClient 4.5.x. Trace how authentication settings are exposed through JMeter's UI or configuration, then verify that the selected canonicalization behavior works for hosts behind a load balancer without breaking existing behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
authentication
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.