NTLM, Kerberos, and Basic: How Authentication Works on Enterprise Proxies
Table of contents
- Introduction: why your proxy's authentication scheme matters more than you think
- Fundamentals: what proxy authentication is and how it differs from regular authentication
- Deep dive: how each protocol works at the byte level
- Method one: basic as the universal language for external proxies
- Method two: ntlm on an enterprise gateway—setup and survival
- Method three: kerberos and negotiate—building the infrastructure without the pain
- Method four: connecting a corporate gateway to an external proxy service
- Common mistakes: what breaks proxy authentication
- Tools and resources: how to work with ntlm, kerberos, and basic
- Case studies and results: how this looks in practice
- Faq: answers to the most common questions
- Conclusion: what to do next
Introduction: Why Your Proxy's Authentication Scheme Matters More Than You Think
Whenever the conversation turns to enterprise proxies, the word NTLM comes up within the first few minutes. Some people recall it with irritation: three exchanges for every new connection, strange headers, incompatibility with half the libraries out there. Others recall it with nostalgia, because NTLM worked faithfully in Windows networks for twenty years and still carries thousands of gateways on its back. And standing right next to it are two other players: the simple and transparent Basic, and the elegant but demanding Kerberos, which in the HTTP world usually hides behind the name Negotiate.
At Proxeon, we deal every day with a situation where a client comes to us asking, "Why won't my script go through the corporate gateway when it works fine from my home network?" In the vast majority of cases, the answer lies not in network reachability and not in blocks, but in which authentication scheme the proxy requires and whether your client supports it. That's exactly the topic of this guide.
One important caveat. We deliberately don't repeat material about diagnosing 407 and 502 codes—we've already published that separately. Here we're talking about the protocol: what exactly travels over the wire, in what order, which headers, which cryptographic operations, and why it works that way. Once you understand the mechanics, you'll stop guessing and start reading traffic like an open book.
Here's what you'll learn in this article:
- how the basic proxy authentication cycle works and how it differs from web server authentication;
- how Basic, NTLM, and Kerberos work step by step—all the way down to the message structure;
- how to configure clients, libraries, and gateways for each scheme;
- how to correctly connect a corporate gateway to an external proxy service;
- which mistakes even experienced admins make and how to avoid them;
- where the industry is heading in 2026 and what that means for your infrastructure.
Fundamentals: What Proxy Authentication Is and How It Differs from Regular Authentication
Two Different Dialogues in One HTTP
Let's start with a fundamental distinction that many people miss. HTTP has two independent authentication mechanisms, and they live in different headers.
- Authentication at the target server: the server responds with code 401 and the WWW-Authenticate header, and the client sends Authorization.
- Authentication at the proxy: the proxy responds with code 407 and the Proxy-Authenticate header, and the client sends Proxy-Authorization.
Why does this matter? Because these headers can be present in the same request simultaneously. Your script might authenticate to a corporate proxy via NTLM while also logging into an external API with a Bearer token. The proxy must not touch Authorization, and the target server will never see Proxy-Authorization because the proxy removes it before forwarding. These are socalled hop-by-hop headers—they only exist on one leg of the path.
The Basic Cycle: Challenge and Response
Every proxy authentication scheme fits into the same framework, which can be described in four steps:
- The client sends a request without credentials (or with them, if it already knows the requirements).
- The proxy responds with code 407 and lists the schemes it's willing to accept in the Proxy-Authenticate header. There may be several: for example, Negotiate, NTLM, and Basic in a single response.
- The client picks the strongest scheme it supports and repeats the request with the Proxy-Authorization header.
- The proxy verifies the data and either forwards the request or returns 407 again.
The difference between schemes lies in what exactly goes inside Proxy-Authorization and how many times steps 2–3 repeat before the proxy says "you're in."
Three Schemes in One Paragraph
If you need to explain the difference to a colleague in under a minute, you could put it like this. Basic is a password written on a slip of paper and passed across the desk: one exchange, no cryptography, protected only by TLS wrapping it. NTLM is a challenge-response: the proxy throws out a random number, the client encrypts it with a hash of the password, the password never travels over the network, but you need three exchanges and the result is bound to the TCP connection. Kerberos is a pass you got in advance from the building's security desk: you arrive at the proxy already holding a ticket, one exchange, the password isn't involved at all, but you need a working infrastructure for issuing those passes.
Where Each Scheme Lives
Basic is described in IETF standards and works anywhere—from a home router to a cloud gateway. NTLM is a proprietary Microsoft protocol, formally documented but not an internet standard; its support in the non-Windows world comes from reverse engineering and the MS-NLMP specification. Kerberos is an open standard that came from academia, and its packaging into HTTP via SPNEGO (the Negotiate mechanism) is also standardized. Understanding this explains why Basic works everywhere, NTLM works almost everywhere, and Kerberos works only where it's been carefully configured.
Deep Dive: How Each Protocol Works at the Byte Level
Basic: Simplicity as a Virtue and a Risk
The client takes a string like username:password, encodes it in Base64, and sends it in the header. It looks like this:
Proxy-Authorization: Basic dXNlcjpwYXNzd29yZA==Notice the word "encodes," not "encrypts." Base64 is a reversible transformation—anyone who sees the header sees the password. That's why Basic only makes sense in two cases: when the connection to the proxy is protected by TLS (the so-called HTTPS proxy), or when the proxy is inside a trusted network segment. When working with an external proxy service, Basic credentials are usually supplemented by or replaced with client IP binding: the proxy trusts the source, not the password. We'll come back to this in the practical section.
One advantage of Basic that's often underestimated: it's stateless. Each request is self-contained and can be sent over any connection, through any load balancer, from any thread. For high-load parsers and multi-threaded systems, this property turns out to be decisive.
NTLM: Challenge-Response in Three Acts
Now for the main character. NTLM is a family of protocols (LM, NTLMv1, NTLMv2) in which the password never leaves the client machine. Derivatives of the password hash travel instead. The dialogue consists of three messages, referred to in the docs as Type 1, Type 2, and Type 3.
- Type 1 (Negotiate). The client sends the Proxy-Authorization: NTLM header with a Base64 block containing flags for supported capabilities, sometimes along with the workstation and domain name. Essentially the client is saying, "I speak NTLM, here are my parameters."
- Type 2 (Challenge). The proxy responds with code 407 and the Proxy-Authenticate: NTLM header, which contains a random server challenge (an eight-byte number), a set of flags, and information about the target domain. This is the challenge.
- Type 3 (Authenticate). The client computes the response. In NTLMv2, this is an HMAC over the password hash (NT hash), the username, the domain, the server challenge, its own client challenge, and a timestamp. The result, along with the username and domain, goes in the Proxy-Authorization: NTLM header. The proxy, which has access to the password hash (directly or through a domain controller), repeats the computation and compares.
What surprises newcomers here? That Type 1 and Type 3 are sent over the same TCP connection. NTLM is a connection-oriented scheme. The proxy remembers the challenge issued for that particular connection and expects the response on that same connection. If the client closes the connection after Type 2 and opens a new one for Type 3, the proxy won't find the context and will start over. That's precisely why keep-alive is critical for NTLM, and why some HTTP libraries—the ones that open a connection per request—are fundamentally incompatible with NTLM.
Second consequence: after a successful Type 3, the proxy considers the connection authenticated, not the individual request. Subsequent requests on the same connection can go through without any header at all. That saves traffic but creates a trap: if a multiplexing load balancer sits between the client and the proxy and mixes requests from different users across the same back-end connections, authentication falls apart.
The Difference Between NTLMv1 and NTLMv2
NTLMv1 uses DES to encrypt the challenge and doesn't include a client challenge, which makes it vulnerable to brute force and precomputed-table attacks. NTLMv2 adds a client challenge and a timestamp, uses HMAC-MD5, and is considered the acceptable minimum. In 2026, any gateway accepting NTLMv1 or, worse, LM responses is a vulnerability, not a compatibility feature. We recommend checking the LmCompatibilityLevel policy on all participants and requiring strictly NTLMv2.
Kerberos: A Ticket Instead of a Password
Kerberos flips the model. Instead of every service checking your password, there's a Key Distribution Center (KDC), typically co-located with a domain controller. The process looks like this:
- When you log in, the client receives a TGT (Ticket Granting Ticket) from the KDC, encrypted with a key derived from your password. The password isn't transmitted over the network—time-based pre-authentication is used instead.
- When the client needs to get through the proxy, it requests a service ticket from the KDC for a specific service name—the SPN. For a proxy, this is usually HTTP/proxy.corp.example.com.
- The KDC issues a ticket encrypted with the proxy service's key. The client can't read it—only pass it along.
- The client packages the ticket into an SPNEGO token and sends it in the Proxy-Authorization: Negotiate header.
- The proxy decrypts the ticket with its key (from the keytab file), verifies the authenticator and timestamp—and lets you through.
One exchange instead of three. No challenge, no state on the proxy until the ticket arrives. The ticket is valid for hours, not seconds, and is reused for new connections. That's why Kerberos on a proxy is not only more secure but also faster than NTLM, especially with a large number of short connections.
Negotiate and SPNEGO: Why the Header Isn't Called Kerberos
The Negotiate header is a wrapper. SPNEGO (Simple and Protected GSSAPI Negotiation Mechanism) lets the client and server agree on a mechanism: Kerberos if available, otherwise NTLM. So a proxy response of Proxy-Authenticate: Negotiate doesn't guarantee Kerberos. If the client doesn't have a ticket (the machine isn't domain-joined, the KDC is unreachable, the SPN isn't registered), SPNEGO will quietly fall back to NTLM within that same Negotiate header. That's convenient for compatibility and painful for diagnostics: your logs show Negotiate, but in reality NTLM is doing its three-exchange, connection-bound dance.
How do you tell the difference? The first Negotiate token with Kerberos inside starts in Base64 with characteristic characters corresponding to the ASN.1 structure of GSS-API, and it's large—a ticket weighs hundreds of bytes or more. A Negotiate token with NTLM inside contains the NTLMSSP signature and is noticeably shorter. In Wireshark, both cases are decoded and clearly labeled.
A Comparison Table in Text Form
- Number of exchanges for the first request: Basic—one; NTLM—three; Kerberos—one (with a ticket in hand).
- Connection binding: Basic—no; NTLM—yes; Kerberos—no.
- Password sent over the network: Basic—yes, in the clear (TLS is the only protection); NTLM—no, only derivatives; Kerberos—no.
- Infrastructure dependencies: Basic—none; NTLM—domain controller or local database on the proxy; Kerberos—KDC, DNS, time synchronization, SPN, keytab.
- Works outside the domain: Basic—yes; NTLM—yes, with explicit login and password entry; Kerberos—only with a ticket obtained via kinit or similar.
- Compatibility with load balancers and connection pools: Basic—excellent; NTLM—requires connection stickiness; Kerberos—good.
Method One: Basic as the Universal Language for External Proxies
When Basic Is the Right Choice
Basic is irreplaceable where the client isn't part of the domain and the proxy isn't part of the corporate network. The classic example: an external proxy service used by parsers, price monitoring tools, SEO analyzers, ad verification systems. The client can be written in anything, run in a container without domain membership, work from the cloud. The only thing it can reliably do is send a header with a username and password.
The second case is testing and debugging. When you're checking a proxy chain, you need a scheme with no hidden state. Basic lets you reproduce a request with a single curl command and see the result.
Two Ways to Trust: Credentials and IP Allowlists
External proxy services, including Proxeon, usually authorize on the port using one of two principles or a combination of them.
- Username and password (Basic). The port accepts requests from any address if the correct credentials are present in the header. Convenient for dynamic environments where the client's address changes.
- IP allowlist. The port accepts requests only from pre-specified addresses and doesn't require a header at all. Convenient for servers with fixed addresses and for clients that can't or shouldn't store a password.
Combining both methods gives layered protection: even a leaked password is useless from a foreign address, and address spoofing won't help without a password. The choice depends on whether the client has a permanent external address and how important it is for you to avoid storing secrets in configs.
Step-by-Step Basic Setup on the Client Side
- Get the host, HTTP proxy port, username, and password from the service. Note: as of 22.09.2026, Proxeon's SOCKS5 port equals the HTTP port plus one—that is, if the HTTP proxy listens on port N, SOCKS5 for the same channel is on port N+1. That's handy to remember and saves you trips to the dashboard.
- Test access with a single command:
curl -x http://login:password@proxy.host:PORT https://example.com/ -I- If you need to send the header explicitly rather than using URL syntax (for debugging, say), build it manually:
curl -x http://proxy.host:PORT -H "Proxy-Authorization: Basic $(printf 'login:password' | base64)" https://example.com/ -I- In Python with the requests library, a proxies dictionary with credentials in the URL is all you need. The library builds the Basic header for HTTP and correctly handles CONNECT for HTTPS.
- In Node.js, use an agent with proxy support and pass credentials via the HTTP_PROXY and HTTPS_PROXY environment variables in the same URL format.
- Make sure the password doesn't end up in logs: many libraries print the full proxy URL during debugging. Use environment variables and masking.
Basic and HTTPS: The CONNECT Method
When accessing an HTTPS resource through an HTTP proxy, the client first sends a CONNECT host:443 request, and that's the request where the Proxy-Authorization header must go. Once the tunnel is established, the proxy no longer sees the content—all headers inside TLS belong to the target server. A common mistake: a developer adds the Basic header to the HTTPS request itself rather than the CONNECT, and gets rejected. Well-designed libraries handle this for you; hand-rolled HTTP clients don't.
Basic Checklist
- The connection to the proxy is protected by TLS, or by the network segment, or by an IP allowlist.
- The password is stored in secrets, not in code and not in URLs in logs.
- The header goes in the CONNECT request for HTTPS targets.
- Characters in the password with special meaning in URLs are percent-encoded.
- Credentials are rotated per policy and revoked when employees leave.
Method Two: NTLM on an Enterprise Gateway—Setup and Survival
Where NTLM Is Still Appropriate
Despite all its flaws, NTLM remains a working choice in three situations: when some clients aren't domain-joined but have domain credentials; when the Kerberos infrastructure isn't deployed or doesn't reach a particular segment; when the gateway serves legacy applications that don't support Negotiate. The big trend in 2026 is a planned phase-out of NTLM, announced by Microsoft, with scenarios migrating to Kerberos, including local KDC and IAKerb mechanisms for devices outside the domain. But "planned" means years, and right now NTLM is something you need to know.
Step-by-Step Client Setup for an NTLM Proxy
- Determine the requirement. Send a request with no credentials and look at the Proxy-Authenticate header. If it only offers NTLM, you have no choice. If it offers both Negotiate and NTLM, Negotiate is preferable, but NTLM remains the fallback.
- Test with curl. The --proxy-ntlm flag enables the scheme, and credentials go via --proxy-user in the format DOMAIN\user:password, though in the examples we write the entity instead of a backslash:
curl --proxy-ntlm --proxy-user "CORP\jdoe:secret" -x http://gw.corp.local:8080 https://example.com/ -I- In Python, use requests extensions with NTLM support (requests-ntlm, for example, or httpx-ntlm with the pyspnego library). It's important to enable sessions: the session object is what guarantees reuse of the TCP connection between Type 1 and Type 3.
- In .NET and Java, integrated authentication is built in: just point to the proxy and allow default credentials—the client will handle NTLM under the current user on its own.
- For apps without NTLM support, use a local authenticating proxy intermediary: it listens on localhost without authentication and goes out via NTLM on your behalf. This is the standard corporate trick for containers, old tools, and scripts.
- Check keep-alive. If your client adds Connection: close or disables connection pooling, NTLM won't work. Make sure the connection stays open between the second and third messages.
Step-by-Step Gateway Setup Using Squid as an Example
- Join the server to the domain via Samba and winbind to gain access to hash verification through the domain controller.
- Enable the ntlm_auth helper in Squid's configuration as an auth_param for the ntlm scheme. Set the number of child processes high enough for the peak of simultaneous handshakes—each Type 2 holds a slot while it waits for Type 3.
- Set the keep_alive parameter in auth_param so Squid doesn't close the connection after returning a 407 with a challenge.
- Declare an ACL requiring authentication and apply it to http_access.
- If the gateway also supports Negotiate, put Negotiate above NTLM in the auth_param list—the client picks the first scheme it supports, and the order in the proxy's response affects that choice.
- Disable NTLMv1 and LM at the domain level via Group Policy; on the proxy side, verify that winbind isn't accepting weak responses.
Why NTLM Doesn't Play Well with Multithreading
Picture a parser opening a hundred connections to the gateway. Each connection goes through three exchanges. That's already three hundred HTTP transactions before the first useful byte. Add to that the fact that the proxy holds context for each unfinished handshake and that any connection reset forces a fresh start. If your client uses a pool with long-lived connections, the overhead is tolerable. If every request opens a new connection, NTLM becomes a bottleneck. That's exactly why, if the gateway supports Negotiate, moving clients to Kerberos almost always gives a noticeable speedup, even without changing a line of code.
NTLM Checklist
- The client reuses the TCP connection between Type 1 and Type 3.
- Only NTLMv2 is used; LM and NTLMv1 are banned by policy.
- No multiplexing load balancer without session stickiness sits between the client and the proxy.
- The gateway has enough helper processes for peak simultaneous handshakes.
- The domain is explicitly specified in the credentials wherever the client isn't domain-joined.
- There's a migration plan toward Negotiate/Kerberos.
Method Three: Kerberos and Negotiate—Building the Infrastructure Without the Pain
The Four Pillars of Kerberos
Kerberos on a proxy works only when four conditions hold true simultaneously. Remember them as a formula: time, name, key, trust.
- Time. The clocks on the client, proxy, and KDC must be synchronized within the allowed window. A discrepancy beyond the limit means the ticket is rejected. Use NTP on all nodes.
- Name. The client requests a ticket for the SPN it builds from the proxy hostname as specified in its settings. If the settings use an IP address or a short name without the domain, the SPN won't match the registered one and the client will fall back to NTLM. The proxy must be specified by its fully qualified domain name, and that name must have both forward and reverse DNS records.
- Key. The proxy must have a keytab file containing the service key corresponding to the SPN. If the key is stale after a service account password change, ticket decryption will fail.
- Trust. The client must trust the proxy's zone: browsers and system settings have lists of trusted sites for integrated authentication, and the proxy must be on them, or the client won't send a ticket.
Step-by-Step Kerberos Setup on the Gateway
- Create a service account for the proxy in the domain.
- Register an SPN of the form HTTP/proxy.corp.example.com for that account. Verify the SPN is unique: a duplicate SPN in the domain breaks ticket issuance for both services.
- Generate a keytab with keys for that SPN and move it to the proxy server with permissions for the proxy process only.
- In Squid, enable auth_param negotiate with the negotiate_kerberos_auth helper, specifying the keytab path via the KRB5_KTNAME environment variable.
- Configure krb5.conf: the realm, the KDC address, and the mapping of DNS domains to realms.
- Verify ticket issuance on the server: run kinit for a test user and request a service ticket with kvno for the proxy SPN.
- Declare an ACL requiring authentication and apply it.
Step-by-Step Client Setup
- Make sure the machine is domain-joined or has obtained a TGT via kinit.
- Specify the proxy by its full name, not by IP.
- Test with curl using the --proxy-negotiate flag and an empty username—the library will pull the ticket from the cache:
curl --proxy-negotiate --proxy-user : -x http://proxy.corp.example.com:8080 https://example.com/ -I- For Python, use requests-kerberos or pyspnego; for Java, the built-in mechanism via system properties and JAAS configuration; for .NET, default credentials.
- In browsers, add the proxy name to the list of hosts allowed for delegation and integrated authentication—otherwise the client will send NTLM.
- Check the ticket cache with klist: a service ticket for the proxy SPN should appear there. If it doesn't, SPNEGO chose NTLM, and you need to look for the cause among the four pillars.
Kerberos Outside the Domain: The 2026 Scenario
Not long ago, Kerberos was synonymous with "domain-joined machines only." That's changing. The industry is moving toward scenarios where a device outside the corporate network obtains a ticket through a secure channel to the KDC without contacting the domain controller directly. For proxy admins, this means the share of NTLM will shrink naturally as clients upgrade, and Negotiate will become the only integrated scheme. Plan your gateway configurations so that NTLM is an explicitly disableable option rather than part of the foundation.
Kerberos Checklist
- NTP on the client, proxy, and KDC.
- The proxy is specified by FQDN; DNS has both forward and reverse records.
- The SPN is registered and unique.
- The keytab is current and protected with access permissions.
- The proxy is on the trusted hosts list on clients.
- klist shows a service ticket after the first request.
Method Four: Connecting a Corporate Gateway to an External Proxy Service
The Task Every Other Company Faces
Imagine: there's a gateway inside the network with NTLM or Kerberos, and outside you need a pool of external addresses—for search result monitoring, ad localization checks, testing regional versions of a site, load-testing your own services from different addresses. The external proxy service offers Basic or an IP allowlist. How do you combine them?
You need to understand clearly: these aren't one authentication but two independent ones, on two different legs of the path. The client authenticates to the corporate gateway with one scheme, and then—through the tunnel—to the external proxy with another. They don't conflict if you've built the chain correctly.
Option A: A CONNECT Chain
The client sends a CONNECT external-proxy.host:PORT request to the corporate gateway with NTLM or Negotiate in Proxy-Authorization. The gateway establishes a TCP tunnel to the external proxy. Inside the tunnel, the client talks to the external proxy directly and sends it Basic in its own CONNECT or in a regular request. For this to work, the corporate gateway must allow CONNECT to the required port—often the policy only allows 443, and that's the first thing to check with your admins.
From a code perspective, this means two levels of proxy configuration. Not all libraries handle "proxy through a proxy" out of the box. The practical solution is a local intermediary that accepts connections without authentication, goes through the corporate gateway with the integrated scheme, and then forwards traffic to the external proxy with Basic.
Option B: A Dedicated Egress Node with an Allowlist
If the company has a server with a fixed external address (a DMZ node or a cloud instance, say), the external proxy can be configured to trust that address without a password. The node then becomes the single egress point: internal clients authenticate to it via the corporate scheme, and it talks to the external proxy. No passwords are stored anywhere, and the external service sees only one address. This approach simplifies auditing and access revocation.
How to Use the External Service's Features
As of 22.09.2026, Proxeon changes IPs on a port in two ways: by timer or via a link/API. For corporate scenarios, this distinction matters. A timer is a "set it and forget it" solution, suitable for background monitoring where the exact moment of the address change isn't critical. Link/API is a managed change you can build into a pipeline: finish a run of checks, call the API, get a new address, keep going. If the external proxy is reachable only through the corporate gateway, bear in mind that the address-change API call will also go through it, and the same authentication rules apply.
The numbers illustrate the scale of these operations well: as of 14.11.2026, IPs on Proxeon ports changed on 7,924 ports per day, with the share of timer-based changes at 51.1% and the rest via link/API. The nearly even split shows that both scenarios are equally in demand, and corporate integration should support both.
Another practical point: as of 22.09.2026, Proxeon's SOCKS5 port equals the HTTP port plus one. This is useful when the corporate gateway only allows CONNECT to specific ports: you know exactly which port to request for HTTP mode and which for SOCKS5, and you can negotiate opening exactly those ports with your admins instead of guessing.
A Scheme-Selection Framework: Five Questions
- Is the client domain-joined? Yes—Negotiate (Kerberos). No, but with domain credentials—NTLM or Basic over TLS. No and no credentials—Basic or an allowlist.
- Are connections short and numerous? Yes—avoid NTLM; choose Kerberos or Basic.
- Is there a load balancer between the client and the proxy? Yes—either session stickiness or a stateless scheme (Basic, Kerberos).
- Is the client a third-party library without integrated auth? Yes—use a local intermediary or Basic.
- Is the client address fixed? Yes—use an IP allowlist as the primary or additional factor on the external proxy.
Integration Checklist
- Two authentication legs are defined, with a scheme for each.
- The corporate gateway allows CONNECT to the external proxy's ports (HTTP and, if needed, SOCKS5 = HTTP + 1 as of 22.09.2026).
- An IP change method is chosen—timer or API—and the API is reachable through the gateway.
- External proxy secrets are stored centrally; where possible, an allowlist is used.
- Logs from both levels are time-aligned for incident investigations.
Common Mistakes: What Breaks Proxy Authentication
Mistake 1. Specifying the Proxy by IP with Kerberos
The most frequent cause of "we have Negotiate, but somehow it's NTLM." The client builds the SPN from whatever you gave it. Give it an IP, and it asks the KDC for a ticket for HTTP/192.0.2.10—no such SPN exists, and SPNEGO falls back to NTLM. The fix is simple: FQDN in the proxy settings, everywhere, always.
Mistake 2. Disabling Keep-Alive with NTLM
Some engineers add Connection: close to every request "for reliability." With NTLM, that's a guaranteed failure: Type 3 goes over a new connection, the proxy can't find the challenge, and it returns a fresh one. You get an endless loop of 407s. Connection reuse is mandatory for NTLM.
Mistake 3. A Load Balancer Between the Client and NTLM Gateway Without Stickiness
A multiplexing load balancer that scatters a single client's requests across different servers or mixes connections turns NTLM into a lottery. The fix is session stickiness by client address or connection, or a migration to a stateless scheme.
Mistake 4. Putting the Basic Header in the HTTPS Request Instead of CONNECT
The proxy can't see inside TLS. If credentials went anywhere but the CONNECT, the proxy will never receive them. Hand-rolled clients make this mistake constantly.
Mistake 5. Mixing Up Authorization and Proxy-Authorization
A developer copies an example for a website and sets the Authorization header, expecting the proxy to read it. The proxy ignores that header—and rightly so; it's not its domain. Check the header name.
Mistake 6. Allowing NTLMv1 "for Compatibility"
This is a hole that lingers for years. Anyone on the network who can listen to traffic gets material to crack. In 2026, the only acceptable policy is NTLMv2 only, with a migration plan toward Kerberos.
Mistake 7. Forgetting to Update the Keytab After a Service Password Change
A scheduled rotation of the proxy account password without reissuing the keytab kills Kerberos instantly: tickets are encrypted with the new key, and the proxy tries to decrypt them with the old one. Include keytab reissuance in your rotation procedure.
Mistake 8. Storing a Basic Password in URLs That End Up in Logs
Libraries love to print the full proxy URL on errors. The password ends up in logs that everyone reads. Use environment variables and masking, and for external proxies, prefer an IP allowlist over a password where possible.
Mistake 9. Assuming That Negotiate in the Header Means Kerberos
We've touched on this, but the mistake is so widespread it deserves its own point. Check klist and the token size. If there's no ticket, look for the cause among time, name, key, and trust.
Mistake 10. Not Agreeing on CONNECT Ports with the Gateway
Corporate gateways often allow CONNECT only to 443. The external proxy listens on different ports. A request to a nonstandard port gets rejected by policy, and it looks like an authentication problem when the real issue is an ACL. Check the allowed ports before hunting for a bug in credentials.
Tools and Resources: How to Work with NTLM, Kerberos, and Basic
For Testing and Debugging
- curl—the reference tool. Flags: --proxy-basic, --proxy-ntlm, --proxy-negotiate, --proxy-anyauth, and -v to see headers. The last flag makes curl pick a scheme from those the proxy offers automatically.
- Wireshark—decodes NTLMSSP and SPNEGO, shows Type 1/2/3 and the contents of Kerberos tickets (minus secrets). Indispensable when you need to prove which scheme actually succeeded.
- klist, kinit, kvno—the standard Kerberos toolkit. klist shows the ticket cache, kinit obtains a TGT, kvno requests a service ticket for the SPN and verifies its version.
- setspn and directory administration tools—to register and verify the uniqueness of SPNs.
- Fiddler, mitmproxy—local intercepting proxies for studying headers on the client side. mitmproxy is handy for reproducing 407 scenarios in tests.
For Gateways
- Squid with the basic_ncsa_auth, ntlm_auth (via Samba), and negotiate_kerberos_auth helpers. The most flexible open platform for all three schemes.
- Samba and winbind—the bridge between a Linux gateway and the domain for NTLM.
- MIT Kerberos and Heimdal—Kerberos implementations for Linux nodes.
For Clients and Libraries
- Python: requests with Basic out of the box; requests-ntlm and pyspnego for NTLM; requests-kerberos for Negotiate; httpx with the corresponding extensions.
- Java: built-in Authenticator and JAAS for Negotiate and NTLM; Apache HttpClient with scheme providers.
- .NET: HttpClientHandler with UseDefaultCredentials—integrated authentication with no effort.
- Go: the standard library supports Basic; for NTLM and Negotiate, third-party modules whose quality is worth verifying.
- Local intermediaries: utilities like cntlm and px that accept local connections without authentication and go through corporate NTLM/Negotiate on the user's behalf. These are "adapters" for applications without integrated support.
For External Proxies
- The service dashboard and API for managing credentials, allowlists, and IP changes. As of 22.09.2026, Proxeon changes IPs via a timer or a link/API, and its SOCKS5 port equals the HTTP port plus one.
- Secret managers for storing Basic logins and passwords outside of code.
Case Studies and Results: How This Looks in Practice
Case 1. A Parser in a Container Behind an NTLM Gateway
The situation: an analytics team runs a Python directory parser in containers. The containers aren't domain-joined. The corporate gateway requires NTLM. The requests library without extensions doesn't do NTLM, and every request ends in a 407.
What they did: deployed a local intermediary in the cluster that listens on an internal port without authentication and goes out via NTLM under a service account with connection reuse. The containers pointed to the intermediary as their proxy via environment variables. They connected the Proxeon external proxy via CONNECT inside the tunnel with Basic, with the password stored only in the cluster's secret, never in code.
The result: the parser started working without code changes; NTLM handshakes are handled by a single process with long-lived connections rather than hundreds of containers. A side effect that pleased the team: the gateway logs got cleaner, because the loops of unfinished handshakes disappeared.
Case 2. Migrating a Gateway from NTLM to Negotiate
The situation: a Squid gateway with ntlm_auth. Users complained about slow page loads on pages with lots of resources. Wireshark diagnostics showed that browsers opened dozens of connections, each going through three exchanges.
What they did: registered the SPN, issued a keytab, added negotiate_kerberos_auth above NTLM in the configuration, synchronized NTP, and switched the proxy settings in Group Policy from IP to FQDN. They kept NTLM as a fallback for machines outside the domain with a plan to disable it.
The result: a service ticket is issued once per user session, and new connections authenticate in a single exchange. The slow-load complaints stopped; the number of helper processes waiting on the gateway dropped. The most interesting discovery came later: some machines were still using NTLM, and it turned out their proxy was specified by IP in the application's local settings. After fixing that, the share of NTLM in the logs fell to a residual level.
Case 3. An Egress Node with an Allowlist Instead of Passwords
The situation: the marketing department checks regional versions of ad campaigns through external addresses. A dozen employees store the external proxy username and password in browser extension settings. Security isn't happy.
What they did: allocated a DMZ node with a fixed external address, added that address to the allowlist on Proxeon ports, and disabled password access. Internal employees authenticate to that node via corporate Negotiate; the node forwards traffic to the external proxy with no secrets at all. They set up IP changes on the ports by timer for background checks and via API for manual sessions when a marketer wants a new address right now. Both methods are available on Proxeon as of 22.09.2026.
The result: not a single password on workstations; an employee's departure no longer requires changing the external service credentials; audits pass based on corporate gateway logs showing the user's domain name. For SOCKS5 scenarios, they used the HTTP-port-plus-one rule (as of 22.09.2026), which made port negotiation with the network team easier.
Case 4. A Load Balancer That Broke NTLM
The situation: the company added a load balancer in front of two NTLM gateways for redundancy. The next day, authentication started working "sometimes."
What they did: Wireshark showed that Type 1 went to one gateway and Type 3 to the other. They enabled stickiness by source address, but some users behind a shared NAT still got mixed up. The final solution was a migration to Negotiate, which doesn't depend on the connection, keeping NTLM only for an isolated segment with session stickiness.
The result: stable authentication under any load distribution. The lesson: adding network infrastructure between the client and the proxy is a reason to revisit your authentication scheme, not just your routing.
FAQ: Answers to the Most Common Questions
Why does the proxy respond with Negotiate when I see NTLM in Wireshark?
Negotiate is the SPNEGO wrapper, which can contain either Kerberos or NTLM inside. If the client couldn't obtain a service ticket (the proxy is specified by IP, there's no time synchronization, the SPN isn't registered, the proxy isn't on the trusted list), SPNEGO automatically chooses NTLM. Check klist: if there's no ticket for HTTP/proxy-name, look for the cause among the four pillars—time, name, key, trust.
Can NTLM be used over HTTP/2?
Practically, no. HTTP/2 multiplexes many requests over a single connection, while NTLM authenticates the connection itself and requires sequential exchanges. Most clients and proxies fall back to HTTP/1.1 when NTLM is involved. Kerberos and Basic are HTTP/2-compatible because they don't depend on the connection.
Is Basic safe if the proxy is inside the corporate network?
Basic's security depends entirely on protecting the channel. Inside the network, traffic can be intercepted at any intermediate node. If the gateway supports TLS on the client side, use it. If not, integrated schemes are preferable, and Basic should be reserved for segments where interception is physically impossible, or for external proxies combined with an IP allowlist.
How do I tell which scheme curl chose with --proxy-anyauth?
Run with the -v flag: curl will show the received Proxy-Authenticate header and the sent Proxy-Authorization header with the scheme name. curl's preference order goes from strongest to weakest among the available options, but the outcome depends on what your curl build includes: NTLM and Negotiate support require the corresponding libraries.
Do I need to store a password for Kerberos on the proxy server?
No. The proxy stores a keytab—a file with the service key derived from the service account password. The proxy never sees users' passwords: it receives a ticket encrypted with the service key and an authenticator confirming that the ticket was presented by its rightful owner.
How do I properly combine corporate Kerberos with an external proxy using Basic?
Separate the two legs. Up to the corporate gateway—Negotiate, which pulls a ticket from the cache. From the gateway to the external proxy—a CONNECT tunnel inside which your client sends Basic to the external proxy. Alternatively, use a dedicated egress node with a fixed address and an allowlist on the external proxy so no password is stored at all. Check that the gateway allows CONNECT to the external proxy's ports; as of 22.09.2026, Proxeon's SOCKS5 port equals the HTTP port plus one, which simplifies matters.
What risk does keeping NTLMv1 for legacy apps pose?
NTLMv1 uses weak cryptography without a client challenge, making responses suitable for brute force and relay attacks. Anyone observing traffic gets material to recover the hash. The right strategy is to isolate the legacy app behind a local intermediary that uses NTLMv2 or Kerberos externally, and to disable NTLMv1 at the domain level.
Why did Kerberos stop working after a service account password change?
The key in the keytab is derived from the password. Changing the password changes the key and increments the key version number (kvno). The KDC starts issuing tickets encrypted with the new key, and the proxy tries to decrypt them with the old one. Reissue the keytab and restart the authentication helper. Include keytab reissuance in your service password rotation procedure.
How do I choose between timer-based and API-based IP changes for corporate monitoring?
A timer suits background tasks where the exact moment of the address change doesn't affect the outcome. An API suits managed scenarios where the address change is tied to an event: finishing a run of checks, starting a new session. As of 14.11.2026, Proxeon's share of timer-based changes was 51.1% of 7,924 ports that changed IPs per day, with the rest via link/API. This suggests both scenarios are roughly equally common. If the API call goes through the corporate gateway, note that the same authentication applies to it as to all other traffic.
What will happen to NTLM in the coming years?
The industry is moving away from NTLM toward Kerberos, including scenarios for devices outside the domain. That doesn't mean NTLM will disappear tomorrow: on gateways, it will remain as a fallback mechanism. But new infrastructure should be designed so that NTLM is a disableable flag, Negotiate with Kerberos is the main path, and for external proxies and third-party clients—Basic over a secure channel or an IP allowlist.
Conclusion: What to Do Next
We've traveled from headers to infrastructure. Now you know that NTLM is three exchanges and connection binding, Kerberos is one exchange with a ticket obtained in advance, and Basic is one exchange with cleartext credentials that only makes sense inside a protected channel or paired with an allowlist. You understand that Negotiate in a header doesn't guarantee Kerberos, that FQDN instead of IP solves half the ticket problems, and that keep-alive solves half the NTLM problems.
Here are the specific next steps we recommend:
- Capture traffic to your gateway in Wireshark and determine which scheme is actually working for you. The result often surprises.
- If you see NTLM where you expected Kerberos, run through the four pillars: time, name, key, trust.
- Disable NTLMv1 and LM via domain policy if you haven't already.
- For external proxies, move access to an IP allowlist through a dedicated egress node, or store Basic credentials in a secret manager.
- Agree on CONNECT ports with your network team in advance, knowing the HTTP-port and SOCKS5-port-plus-one rule (as of 22.09.2026 for Proxeon).
- Decide which IP change method you need—timer or API—and build it into your pipeline with the gateway authentication in mind.
- Put NTLM phase-out on your roadmap as the primary scheme and migrate to Negotiate.
Proxy authentication isn't a routine setting—it's the point where security, performance, and compatibility meet. Once you understand the protocol, you stop depending on luck and get infrastructure you can explain, reproduce, and protect. Bookmark this guide and come back to the checklists every time a new gateway appears between your client and the target resource.