Verifying the Erlang/OTP TLS Patch With Negative Certificate-Validation Tests

Verifying the Erlang/OTP TLS Patch With Negative Certificate-Validation Tests

pr0h0••24 min read•hacking
AI Usage (84%)

The call came the way these calls usually do: the runtime was upgraded, the scanner went green, and someone asked whether the incident was closed. My answer was that the upgrade was answering a different question than the one being asked. This walkthrough shows how to verify an Erlang/OTP TLS patch properly: inventory the runtime that actually opens sockets, build a certificate lab with independent failure cases, and drive negative certificate-validation tests through the real client code so an unexpected accept breaks the build.

An Erlang/OTP TLS advisory is a claim about the library. Whether your service stopped accepting impostor certificates depends on the options your application passes at handshake time, the trust material it loads, and whether a custom callback quietly overrides the verdict. Three separate facts, and each one needs its own evidence.

The procedure below works whether or not you have the advisory in hand yet. The final step — proving the patch fixed the specific defect — requires the primary source, and I'll be explicit about where that boundary sits.

On this page

An Encrypted Connection Is Not Proof of Server Identity

A TLS handshake can complete, negotiate a modern cipher suite, encrypt every byte, and still be talking to an attacker. The cipher protects the channel. The certificate check is what tells you who is on the other end, and in Erlang that check is opt-in.

That is the part most teams skip after patching. They confirm the OTP version changed, restart the pods, and mark the finding remediated. Meanwhile the client still has {verify, verify_none}, or a verify_fun that returns {valid, State} for bad_cert, or an HTTP wrapper that never got the ssl options passed down. The patch fixed the library. The application was never using the library's verdict.

I'd rather find that out from a test than from a postmortem.

Technical Position: Verify Both the Deployed OTP Fix and Application-Level Authentication

My position is blunt: an OTP package upgrade is not remediation, and a passing negative TLS test is not proof that you patched a specific CVE. You need both, in that order of skepticism, and you need to be clear which one you actually demonstrated.

The two failures are independent. A service can run a fully patched OTP and still accept any certificate because of its own configuration. A service can run an unpatched OTP and — if the defect is narrow enough — still reject the ordinary impostor cases because its configuration was already strict. Neither state is safe to assume; both are cheap to measure.

If you take one thing from this walkthrough, take the ordering: prove your application rejects the wrong peer first, then prove the runtime change fixed what the advisory says it fixed. The first result is yours either way, and it is the one that would have caught the incident.

Walkthrough Scope: An Isolated TLS Lab, an Erlang Test Harness, and Explicit Evidence Boundaries

Everything below runs on loopback against certificates I generate on the spot, with two-day validity and nothing leaving the machine. There is one openssl fixture script, one s_server setup, one ~60-line Erlang module, and a comparison procedure for pre-fix versus fixed runtimes.

I'll be explicit about what I could and could not confirm. The supplied source material for this post is thin — a single news item with no CVE, no version ranges, and no advisory text — so I don't name affected releases, I don't describe a vulnerability-specific reproducer, and I don't claim any output below was captured against a real pre-fix build. The harness is deliberately advisory-agnostic so it stays useful once you have the real advisory in front of you.

What the Report Establishes—and What Still Needs Confirmation

The public record here is one report. It's worth separating from everything I would normally assume.

What the Report Claims: Impersonation and Traffic Interception (November 30, 2026)

The supplied material is a Hacker News item dated November 30, 2026 with the headline claim: a critical Erlang/OTP TLS flaw could let attackers impersonate servers and intercept encrypted traffic.

That is the whole of what I can attribute. "Impersonate servers" and "intercept encrypted traffic" are consistent with a failure of server authentication during the handshake — the attacker terminates TLS with a certificate the client should have rejected, then relays or reads traffic. But the headline is a summary, not a mechanism spec, and I'm not going to reverse-engineer a mechanism out of one sentence.

Missing Evidence: No CVE, Affected Releases, Fixed Versions, or Validation Mechanism

Here is the gap list I would put on the incident ticket before touching a build:

NeededStatus in the supplied itemWhy it blocks action
CVE or other advisory identifiernot givencannot match against scanner output or vendor bulletins
Affected OTP releases / ssl versionsnot givencannot decide whether a given host is exposed
Fixed version or patch commitnot givencannot verify the upgrade actually fixes this defect
Exploitation prerequisitesnot givencannot judge whether network position alone is enough
Which validation step failsnot givencannot design a defect-specific regression test
Whether a workaround existsnot givenpatch urgency and mitigation options unknown

Every row maps to a real engineering task. Without the CVE identifier I can't reconcile against an SBOM. Without affected versions I can't build a list of exposed hosts. Without the failing validation step I can't tell whether my negative tests are even aimed at the right code path.

Find the Official Erlang/OTP Advisory Before Naming Versions or Writing a Reproducer

The correct next step is the primary source, not more coverage. For Erlang/OTP that means the project's own security advisory feed and the release notes for the ssl and public_key applications — the Erlang/OTP security advisories on GitHub and the release tags.

I didn't have that advisory while writing this, so I won't name a version range or a fixed release. Inventing one would send readers to a version that may not exist.

⚠️

If you only have a news article, you do not yet know what to patch. Treat any post — including this one — that names affected versions without a link to the advisory as unverified. Get the advisory first, then come back and run the procedure below against it.

What I can give you is a test procedure that works regardless of which validation step turns out to be broken, plus the decision rules for reading the result once you know.

Inventory the Erlang Runtime Actually Making TLS Connections

Before any certificate work, find out what's running. The version on your laptop doesn't matter; the version inside the process that opens the socket is the only one that counts, and in Erlang deployments those are frequently different.

Collect Runtime Evidence with erl, erlang:system_info/1, and application:get_key/2

application:get_key/2 returns undefined until the application is loaded, which is the most common way people get a misleading "unknown" answer. Load first, then read.

runtime-fingerprint.sh
erl -noshell -eval '
{ok, _} = application:ensure_all_started(ssl),
io:format("otp_release=~s~nerts=~s~nssl=~s~n",
          [erlang:system_info(otp_release),
           erlang:system_info(version),
           case application:get_key(ssl, vsn) of
             {ok, V}   -> V;
             undefined -> "ssl-not-loaded"
           end]),
halt().'

The shape of the output (illustrative — your numbers will differ):

otp_release=27
erts=15.2
ssl=11.2.1

Three numbers, three purposes. otp_release is the coarse identifier that advisories and vendor bulletins usually speak in. erts disambiguates patch-level rebuilds that share an OTP major. The ssl application version is the one I record in the incident ticket, because a backport can ship a patched ssl inside a nominally older OTP.

That last point matters more than it sounds. Distributions and platform vendors backport security fixes without bumping the OTP major, so otp_release=25 on one host and otp_release=25 on another can mean two different ssl builds.

Inspect Running Releases, Containers, and Bundled Runtimes, Not Your Laptop's OTP

Erlang runtimes get bundled in ways that hide them. A mix release tarball carries its own ERTS. A container image pins an OTP the Dockerfile no longer reflects. A CI runner has a system Erlang plus an asdf-managed one plus whatever a plugin cached.

## Release-style (Elixir) deployment: ask the release, not the host
bin/my_app eval 'IO.puts("otp=#{System.otp_release()} ssl=#{inspect(Application.spec(:ssl, :vsn))}")'

## Container: exec inside the actual image
docker exec -it my_app_container erl -noshell \
  -eval 'io:format("~s~n",[erlang:system_info(otp_release)]), halt().'

## Stray runtimes on disk that a PATH lookup would miss
find / -maxdepth 6 -name start_erl.data 2>/dev/null

If erl is not on the image's PATH, start_erl.data under releases/ still tells you which ERTS the release boots with.

Build an Evidence Table Mapping OTP and ssl Versions to Advisory Status

One row per workload, filled in from runtime output rather than from a manifest:

WorkloadRuntime pathOTPssl vsnAdvisory statusBackport confirmedRestarted into this runtime
api-gateway/opt/app/releases/2.4.1/2711.2.1pending advisory mappingn/ayes — start time after deploy
billing-workercontainer billing:1.9.02610.9.0pending advisory mappingcheck distrono — old pod still running
internal-toolhost package2510.4.2pending advisory mappinglikelyunknown

The "restarted into this runtime" column exists because patching the image does nothing for the pod that's been running since Tuesday. I check process start time against the deploy timestamp, and I prefer a runtime fingerprint emitted at boot into logs so I can prove it after the fact.

Trace the Server-Authentication Boundary

Once you know what's deployed, trace what the application actually asks the ssl application to do. This is where the interesting bugs live, and they're usually not in OTP.

Follow the Connection from Application Config Through ssl:connect to Chain and Identity Checks

The client path is: application config → HTTP client library → ssl:connect/4 with an option list → chain building and signature checks against the configured trust anchors → identity check of the peer certificate against a reference name.

Two independent things must both hold. The chain must terminate in a CA you trust, and the certificate must be valid for the name you intended to reach. Break either and the peer is unauthenticated — but the alert you get, and sometimes whether you get one at all, differs.

Separate verify_peer, CA Inputs, Hostname Verification, SNI, and Custom Callbacks

These options get conflated constantly, and the conflation is why "we enabled TLS verification" sometimes means nothing:

OptionWhat it actually controlsFailure mode I look for
verifywhether the peer certificate is validated at allleft at verify_none; handshake always succeeds
cacertfile / cacertsthe anchors the client trustsstale bundle, empty list, or the server's cert used as its own anchor
server_name_indicationthe name sent to the server, and the source of the reference identityset to disable in an HTTPS client
customize_hostname_checkwildcard matching rules for the identity checkabsent, so wildcard certs fail and someone "fixes" it by disabling verification
verify_funa user callback that can override every validation decisionreturns {valid, _} for bad_cert
depthmaximum chain lengthset high enough to accept long attacker-supplied chains
partial_chainaccepts chains that do not reach a self-signed rootwidens trust beyond the intended anchor set

Two notes on defaults, because they drive most real findings. In the OTP releases I have deployed, ssl:connect/3 defaults the client to verify_none — a handshake against a self-signed certificate succeeds unless you ask otherwise. Check that against the ssl documentation for your release rather than trusting this paragraph; the Erlang ssl reference manual and the Using SSL guide are the authority.

Second: the reference identity is taken from server_name_indication when set, and otherwise derived from the Host argument of ssl:connect/3. I always set it explicitly in tests. Not because the default is broken, but because I don't want my test's meaning to depend on how a particular release resolves that default.

If server_name_indication is disable and you connected by IP address, the identity check has nothing useful to compare against, and the result is often not the error you expect.

Define the Impact Boundary: Impersonation Needs a Connection Opportunity and an Auth Failure

An attacker who impersonates a server needs two things: a position that lets them receive your connection, and a client that fails to reject their certificate. Position could be DNS manipulation, a hostile network, a compromised proxy, or a mis-issued certificate. Authentication failure is the part you control.

Worth stating impact precisely. This isn't a cipher break. The bytes really are encrypted — to the attacker. What you lose is the guarantee about who you're talking to, and everything that follows: credentials submitted to the wrong endpoint, responses shaped by the wrong party, a plausible-looking session in the logs.

If the underlying defect turns out to be in how OTP validates something specific — a chain-building edge case, an extension handling bug — then this procedure will show it only as an outcome change on the affected fixtures. It won't tell you the mechanism. That's what the advisory regression case is for, and I come back to it below.

Build a Local Certificate Lab With Independent Failure Cases

I want three fixtures that fail for exactly one reason each. If a negative test fails for two reasons at once, you learn nothing when it starts passing.

Generate a Disposable CA, an Untrusted CA, and SAN-Bearing Server Certificates

These are throwaway keys with two-day validity. OpenSSL 3.x is assumed; -copy_extensions copy is a 3.0 feature.

make-lab.sh
set -eu
mkdir -p lab && cd lab

## CA 1: the anchor the client will trust
openssl req -x509 -newkey rsa:2048 -nodes -days 2 -keyout ca1.key -out ca1.pem -subj "/CN=HackyJS Lab Root CA 1" -addext "basicConstraints=critical,CA:TRUE" -addext "keyUsage=critical,keyCertSign,cRLSign"

## CA 2: exists in the lab, absent from the client trust file
openssl req -x509 -newkey rsa:2048 -nodes -days 2 -keyout ca2.key -out ca2.pem -subj "/CN=HackyJS Lab Root CA 2" -addext "basicConstraints=critical,CA:TRUE" -addext "keyUsage=critical,keyCertSign,cRLSign"

make_leaf() {  # $1=file stem  $2=SAN  $3=CA stem
openssl req -new -newkey rsa:2048 -nodes   -keyout "$1.key" -out "$1.csr" -subj "/CN=lab.invalid"   -addext "subjectAltName=$2"   -addext "basicConstraints=critical,CA:FALSE"   -addext "keyUsage=critical,digitalSignature,keyEncipherment"   -addext "extendedKeyUsage=serverAuth"
openssl x509 -req -in "$1.csr" -CA "$3.pem" -CAkey "$3.key"   -CAcreateserial -days 2 -sha256 -copy_extensions copy -out "$1.pem"
}

make_leaf good      "DNS:server.lab.test" ca1
make_leaf untrusted "DNS:server.lab.test" ca2
make_leaf wrongid   "DNS:other.lab.test"  ca1

The leaf certificates deliberately keep CN=lab.invalid and put the real name only in subjectAltName. Modern validators consider SAN and ignore CN, so this setup also tells you whether a given client is doing something legacy.

Prepare Three Fixtures: Trusted Matching, Untrusted Matching, and Trusted Mismatched Identity

FixtureIssuerSANClient trustsShould the handshake succeed?
good.pemCA 1server.lab.testCA 1yes — positive control
untrusted.pemCA 2server.lab.testCA 1no — chain does not terminate in a trusted anchor
wrongid.pemCA 1other.lab.testCA 1no — chain is fine, identity is wrong

The third row is the one that catches people. A chain-only check calls wrongid.pem perfectly valid, and openssl verify will agree with it:

openssl verify -CAfile ca1.pem good.pem
## good.pem: OK

openssl verify -CAfile ca1.pem untrusted.pem
## CN = lab.invalid
## error 20 at 0 depth lookup: unable to get local issuer certificate
## error untrusted.pem: verification failed

openssl verify -CAfile ca1.pem wrongid.pem
## wrongid.pem: OK          <-- chain valid, identity irrelevant to this command

openssl verify -verify_hostname server.lab.test -CAfile ca1.pem wrongid.pem
## error 62 at 0 depth lookup: hostname mismatch
## error wrongid.pem: verification failed

That contrast is the whole section in two commands: OK for the chain, hostname mismatch once you assert a name. Any client that stops at the first result is encrypted but unauthenticated.

Run OpenSSL TLS Endpoints on Loopback and Decouple Identity from Connection Address

Three servers on three ports, each bound to 127.0.0.1 so nothing is reachable off-host. Session caching and tickets are disabled to force a full handshake on every connection, which matters when we get to application-level pools.

for spec in "8443 good" "8444 untrusted" "8445 wrongid"; do
  set -- $spec
  openssl s_server -accept "127.0.0.1:$1" -cert "$2.pem" -key "$2.key" \
    -www -quiet -no_ticket -no_cache >/dev/null 2>&1 &
  echo $! > "s_server_$1.pid"
done
sleep 1 && ss -ltn 'sport = :8443 or sport = :8444 or sport = :8445'

The critical design choice: the client connects to 127.0.0.1 but asserts the identity server.lab.test. Address and identity are decoupled, which is exactly how DNS-based impersonation works and exactly what a test that connects to https://server.lab.test with a hosts-file entry would hide.

Cleanup, so a stray key doesn't survive the session:

kill $(cat s_server_*.pid) 2>/dev/null || true
rm -rf lab

Write an Erlang Harness That Rejects the Wrong Peer

The harness has one job: turn "did the client authenticate the server?" into a pass/fail exit code.

Establish the Positive Control with Explicit Trust, a Reference Hostname, and Socket Cleanup

Before any negative case can be trusted, the matching fixture must succeed. Otherwise a "reject" result might just mean the harness is broken.

tls_neg_check.erl
-module(tls_neg_check).
-export([main/0]).

-define(PEER, "server.lab.test").
-define(CACERT, "ca1.pem").
-define(TIMEOUT, 5000).

%% {label, server port, expectation}
cases() ->
  [{trusted_matching,   8443, accept},
   {untrusted_matching, 8444, reject},
   {trusted_mismatched, 8445, reject}].

client_opts() ->
  [{verify, verify_peer},
   {cacertfile, ?CACERT},
   {server_name_indication, ?PEER},
   {customize_hostname_check,
    [{match_fun, public_key:pkix_verify_hostname_match_fun(https)}]},
   {depth, 3},
   {reuse_sessions, false},
   {active, false}].

main() ->
  {ok, _} = application:ensure_all_started(ssl),
  io:format("otp=~s erts=~s ssl=~s~n",
            [erlang:system_info(otp_release),
             erlang:system_info(version),
             ssl_vsn()]),
  Outcomes = [run_case(C) || C <- cases()],
  lists:foreach(fun print/1, Outcomes),
  case [N || {N, _, _, V} <- Outcomes, V =/= pass] of
      []  -> halt(0);
      Bad -> io:format("not-passing: ~p~n", [Bad]), halt(1)
  end.

ssl_vsn() ->
  case application:get_key(ssl, vsn) of
      {ok, V}   -> V;
      undefined -> "unknown"
  end.

run_case({Name, Port, Expect}) ->
  Observed =
      try ssl:connect("127.0.0.1", Port, client_opts(), ?TIMEOUT) of
          {ok, Sock}    -> ssl:close(Sock), accepted;
          {error, Rsn}  -> classify(Rsn)
      catch
          Class:Reason -> {harness_error, Class, Reason}
      end,
  {Name, Expect, Observed, verdict(Expect, Observed)}.

classify({tls_alert, {Alert, _Text}})          -> {rejected, Alert};
classify({tls_alert, Text}) when is_list(Text) -> {rejected, legacy_alert};
classify({options, _} = Err)                   -> {setup_error, Err};
classify(timeout)                              -> {setup_error, timeout};
classify(econnrefused)                         -> {setup_error, econnrefused};
classify(Other)                                -> {other_error, Other}.

verdict(accept, accepted)          -> pass;
verdict(reject, {rejected, _})     -> pass;
verdict(_, {setup_error, _})       -> inconclusive;
verdict(_, {harness_error, _, _})  -> inconclusive;
verdict(accept, {rejected, _})     -> fail;
verdict(_, accepted)               -> fail;
verdict(_, _)                      -> inconclusive.

print({Name, Expect, Observed, V}) ->
  io:format("~-20p expect=~-8p observed=~-30p ~p~n",
            [Name, Expect, Observed, V]).

The positive control carries {verify, verify_peer}, an explicit cacertfile, an explicit reference identity, a five-second timeout, and an ssl:close/1 on success so a passing case doesn't leak the socket and skew the next run.

Add Table-Driven Negative Tests That Change Only the CA or Server Identity

Every case uses the identical client_opts() list. The only thing that changes between rows is which server is listening on the port — one fixture signed by a foreign CA, one fixture with a mismatched SAN. Trust material, reference identity, timeout, and depth stay constant.

That's deliberate. If client_opts() changed per case, a pass could mean "the option I tweaked happened to work" rather than "the client rejected the wrong peer."

Assert Rejection Without Hard-Coding Alert Text; Fail on Unexpected Success

The alert atom in a handshake failure varies by OTP release — unknown_ca in one version, handshake_failure or bad_certificate in another, and pre-21 releases returned a bare string instead of a tuple. Asserting on the exact alert produces a test that breaks on upgrade for no security reason, so classify/1 normalizes every tls_alert to {rejected, _} and only records the atom for diagnostics.

The failure direction that matters is the asymmetric one. A negative case that errors out because the port was closed is not a pass — it's a broken test, reported as inconclusive, which also fails the run. A negative case that succeeds is a real finding and reported as fail. Both exit non-zero, but the label tells the on-call engineer whether to look at the network or the certificate logic.

Show Runnable Commands and Expected Transcripts, Clearly Labeled as Illustrative

erlc tls_neg_check.erl
erl -noshell -eval 'tls_neg_check:main()'
echo "exit=$?"

Expected shape of a healthy run (illustrative — the alert atoms are version-dependent and your ssl version will print differently):

otp=27 erts=15.2 ssl=11.2.1
trusted_matching     expect=accept observed=accepted                        pass
untrusted_matching   expect=reject observed={rejected,unknown_ca}           pass
trusted_mismatched   expect=reject observed={rejected,handshake_failure}    pass
exit=0

And the run that should stop a deploy — someone left verification off, or a callback started approving everything:

trusted_matching     expect=accept observed=accepted                        pass
untrusted_matching   expect=reject observed={rejected,unknown_ca}           pass
trusted_mismatched   expect=reject observed=accepted                        fail
not-passing: [trusted_mismatched]
exit=1

To be precise about provenance: the two blocks above describe the expected behavior of the harness against the three fixtures. They are not a captured run against a vulnerable build, because the supplied material doesn't identify the defect and I didn't have a pre-fix release to name. Run the harness yourself and capture your own transcript — that transcript, not this one, belongs in the incident ticket.

Determine Whether the Patch Fixed This Specific Vulnerability

Only now, with application-side authentication measured, is it worth asking whether the OTP change mattered.

Run the Same Fixtures Against Isolated Pre-Fix and Fixed Runtimes

Two runtimes, two containers (or two release tarballs unpacked side by side), the same tls_neg_check.erl, the same ca1.pem, the same server fixtures, the same client_opts(). Difference only in the OTP/ssl build.

Keep the pre-fix runtime off any network you care about — it's, by assumption, vulnerable to something you don't fully understand yet. Loopback only.

If a pre-fix build isn't published as a package, build it from source at the release tag. Record the tag and commit hash in the ticket, because "pre-fix build" without an identifier is not evidence.

Add the Advisory-Specific Regression Case Only After You Know the Defect

This is the part I won't fudge. My three fixtures test two generic properties: chain validation and reference-identity matching. If the advisory's defect lives somewhere else — a specific extension interaction, a particular chain shape, an option combination — my tests can pass on both builds and prove nothing about the patch.

Once you have the advisory, add a fourth fixture that reproduces its stated preconditions, and check that it fails on the pre-fix build and passes on the fixed one. That's the only test that speaks to the CVE.

Interpret the Outcome Matrix: Passing, Failing, or Changing Only After the Fix

Pre-fix buildFixed buildReading
rejectsrejectsThe generic tests were never exercising the defect. The patch is unproven by them — but you have also confirmed your application-side authentication works, which is worth keeping as a permanent regression.
acceptsrejectsConsistent with a server-authentication fix. Confirm the client options and trust file were identical across both runs, then add the advisory regression case before closing.
acceptsacceptsTwo likely causes: the fixed build is not the one actually running (stale pod, wrong release path), or application configuration still overrides verification. The inventory table resolves the first; the harness with verify_fun present resolves the second.
rejectsacceptsA regression. Stop and investigate before deploying further.

The second row is the one people want to see, and it's not by itself sufficient. The third row is the one that gets misread as "the patch didn't work" when the real answer is "the patched runtime never started."

Test the Application Path, Not Just ssl:connect

A green harness against ssl:connect/4 proves that an option list works. It doesn't prove your HTTP client uses that option list.

Repeat the Certificate Cases Through the App's Real HTTP Client or TLS Wrapper

Re-run the same three fixtures through whatever the service actually calls. The most common Erlang offender is httpc, where ssl options are per-request and a profile default can quietly win:

httpc:request(get, {"https://127.0.0.1:8443/", []},
              [{ssl, [{verify, verify_peer},
                      {cacertfile, "ca1.pem"},
                      {server_name_indication, "server.lab.test"},
                      {customize_hostname_check,
                       [{match_fun,
                         public_key:pkix_verify_hostname_match_fun(https)}]}]}],
              [{timeout, 5000}]).

Then point the same call at 8444 and 8445 and require an error both times. If 8445 returns 200, you have found exactly the impersonation condition the advisory headline describes, independent of any CVE.

Also grep for the permissive patterns before writing any new test:

grep -Rn --include=*.erl --include=*.ex --include=*.exs \
  -e 'verify_none' -e 'verify: *:verify_none' \
  -e 'bad_cert' -e 'customize_hostname_check' \
  -e 'ssl_opts' -e 'ssl_options' .

The callback that defeats everything looks like this, and it's worth recognizing on sight:

{verify_fun, {fun(_, {bad_cert, _}, S)  -> {valid, S};
                (_, {extension, _}, S)  -> {unknown, S};
                (_, valid, S)           -> {valid, S};
                (_, valid_peer, S)      -> {valid, S}
             end, []}}

This isn't a subtle misconfiguration. It explicitly converts a failed validation into a success. If it's in your codebase, the OTP patch is irrelevant to that service until it's removed.

Force Fresh Connections and Exercise Each TLS Mode the App Enables

Connection pools and TLS session resumption let a subsequent request skip the full handshake. A pooled client that already has a session against the good fixture may never re-validate when you point it at the bad one.

Disable resumption in the test configuration ({reuse_sessions, false}, -no_ticket -no_cache on the server side) and open a fresh pool per case. In hackney, Mint, Finch, or Req, that usually means a new pool name or a close-then-start around each case rather than reusing a warm one.

Test each mode the application actually enables, not just the default. If some call sites pass verify_peer and others don't, the harness should have a case per configuration, and the configuration name should be in the test label so a failure points at a call site.

Make CI Fail on Unexpected Acceptance and Keep Lab Keys in the Test Job

Wire the harness into CI with the exit code doing the work:

  • Generate fixtures per job into a temporary directory. Do not commit keys, do not cache them, do not reuse a lab from a previous run.
  • Clean up with a trap so a failed job doesn't leave s_server processes bound to loopback ports.
  • Log the decision, not the material: the case label, the normalized observed value, the otp/ssl versions. Never log private keys or full certificate bodies.
  • Treat inconclusive as a failure of the job. A setup error that lets the job pass is how the test erodes into decoration.
💪

Run the negative cases against your deployed staging configuration, not a hand-written option list. The whole point is to catch the options the application actually passes — including the ones a wrapper adds on your behalf.

Close the Incident With Evidence, Not a Package Upgrade Alone

Closing the ticket is a documentation exercise, and it's where most of the value gets lost.

Prioritize the Advisory Fix, Remove Insecure Overrides, and Verify Restarts

Order of work, and I'd defend this order: apply the advisory's recommended fix first, because that's the only thing that addresses the CVE. Then remove every verify_none and permissive verify_fun on client paths, because that's what would have made the CVE exploitable against you. Then verify restarts, because a patched image behind an un-restarted pod is a false sense of security with a deployment timestamp.

That third step isn't a formality. I check the boot-time runtime fingerprint in the logs against the deploy time, and I re-run the harness against the restarted instance.

Record Versions, Auth Settings, Test Results, and Untested Paths in the Report

What goes in the report:

Recorded itemExample entry
Deployed runtimeotp=27 erts=15.2 ssl=11.2.1, captured from the running node after restart
Advisory mappingwhich advisory line this runtime satisfies, with a link to the primary source
Auth settings per call siteverify_peer, explicit cacertfile, server_name_indication set, wildcard match fun present
Generic negative resultsthree fixtures, expected versus observed, harness exit code
Advisory regression resultthe specific case from the advisory, pre-fix and post-fix
Not testedanything you skipped — non-default TLS modes, third-party callbacks, mutual TLS paths

That last row is the one people omit and the one that makes a report honest. "Not tested: client certificate paths on the internal gRPC listener" is a useful sentence. Silently implying full coverage is not.

Further Reading and Verification Sources

None of the lab material here is version-specific, which is the point. The fixtures and the harness will still be meaningful after you have the real advisory in hand — the only thing that changes is which fourth case you add, and what you write in the "advisory regression result" row.

Share this post

More posts

Loading comments…