Skip to content

Conversation

@somecookie
Copy link
Contributor

@somecookie somecookie commented Jan 13, 2026

Our TLS Server Hello parser does not treat legacy servers specially, but
enabling legacy server support in OpenSSL allows OpenSSL to advance
enough in its Server Hello processing to provide our SslBump code with
the server certificate (that we then validate). Successful certificate
validation, in turn, may result in Squid splicing the connection, even
if OpenSSL detected other errors:

noteNegotiationError: hold TLS write on FD 15 despite
SQUID_TLS_ERR_CONNECT+TLS_LIB_ERR=2000068+TLS_IO_ERR=1

A spliced connection allows the TLS client to handle a legacy server the
way the client needs to handle it, without unwanted Squid meddling.

This is a Measurement Factory project.

rousskov and others added 2 commits January 13, 2026 13:14
Our TLS Server Hello parser does not treat legacy servers specially, but
enabling legacy server support in OpenSSL allows OpenSSL to advance
enough in its Server Hello processing to provide our SslBump code with
the server certificate (that we then validate). Successful certificate
validation, in turn, may result in Squid splicing the connection, even
if OpenSSL detected other errors:

    noteNegotiationError: hold TLS write on FD 15 despite
    SQUID_TLS_ERR_CONNECT+TLS_LIB_ERR=2000068+TLS_IO_ERR=1

A spliced connection allows the TLS client to handle a legacy server the
way the client needs to handle it, without unwanted Squid meddling.

This PR was created with input and collaboration from The Measurement
Factory
@rousskov rousskov changed the title Set ssl op legacy server connect Set SSL_OP_LEGACY_SERVER_CONNECT when peeking at servers Jan 13, 2026
Copy link
Contributor

@rousskov rousskov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The earlier variation of these changes was tested in production. This master-based variation was lab-tested.

Eventually, we may decide to enable more TLS peeking workarounds here, but I think it is best to start with this minimal PR.

Ideally, we should probably remove OpenSSL as the peeking mechanism driver, so that Squid code can look at raw TLS server handshake bytes (something we already do!) without having to work around OpenSSL restrictions, but that is a much bigger long-term change (that may even become impossible as TLS protections advance).

@rousskov rousskov added the S-could-use-an-approval An approval may speed this PR merger (but is not required) label Jan 13, 2026
@yadij
Copy link
Contributor

yadij commented Jan 13, 2026

Any reason this is not also done for the "stare" mode? I would expect to see the same issues occuring for that.

@yadij yadij added M-cleared-for-merge https://github.com/measurement-factory/anubis#pull-request-labels backport-to-v7 maintainer has approved these changes for v7 backporting labels Jan 13, 2026
squid-anubis pushed a commit that referenced this pull request Jan 15, 2026
Our TLS Server Hello parser does not treat legacy servers specially, but
enabling legacy server support in OpenSSL allows OpenSSL to advance
enough in its Server Hello processing to provide our SslBump code with
the server certificate (that we then validate). Successful certificate
validation, in turn, may result in Squid splicing the connection, even
if OpenSSL detected other errors:

    noteNegotiationError: hold TLS write on FD 15 despite
    SQUID_TLS_ERR_CONNECT+TLS_LIB_ERR=2000068+TLS_IO_ERR=1

A spliced connection allows the TLS client to handle a legacy server the
way the client needs to handle it, without unwanted Squid meddling.

This is a Measurement Factory project.
@squid-anubis squid-anubis added the M-waiting-staging-checks https://github.com/measurement-factory/anubis#pull-request-labels label Jan 15, 2026
@squid-anubis squid-anubis added M-abandoned-staging-checks https://github.com/measurement-factory/anubis#pull-request-labels and removed M-waiting-staging-checks https://github.com/measurement-factory/anubis#pull-request-labels labels Jan 15, 2026
@rousskov rousskov removed S-could-use-an-approval An approval may speed this PR merger (but is not required) M-abandoned-staging-checks https://github.com/measurement-factory/anubis#pull-request-labels labels Jan 15, 2026
squid-anubis pushed a commit that referenced this pull request Jan 16, 2026
Our TLS Server Hello parser does not treat legacy servers specially, but
enabling legacy server support in OpenSSL allows OpenSSL to advance
enough in its Server Hello processing to provide our SslBump code with
the server certificate (that we then validate). Successful certificate
validation, in turn, may result in Squid splicing the connection, even
if OpenSSL detected other errors:

    noteNegotiationError: hold TLS write on FD 15 despite
    SQUID_TLS_ERR_CONNECT+TLS_LIB_ERR=2000068+TLS_IO_ERR=1

A spliced connection allows the TLS client to handle a legacy server the
way the client needs to handle it, without unwanted Squid meddling.

This is a Measurement Factory project.
@squid-anubis squid-anubis added the M-waiting-staging-checks https://github.com/measurement-factory/anubis#pull-request-labels label Jan 16, 2026
@squid-anubis squid-anubis added M-merged https://github.com/measurement-factory/anubis#pull-request-labels and removed M-waiting-staging-checks https://github.com/measurement-factory/anubis#pull-request-labels M-cleared-for-merge https://github.com/measurement-factory/anubis#pull-request-labels labels Jan 16, 2026
squidadm pushed a commit to squidadm/squid that referenced this pull request Jan 16, 2026
…#2354)

Our TLS Server Hello parser does not treat legacy servers specially, but
enabling legacy server support in OpenSSL allows OpenSSL to advance
enough in its Server Hello processing to provide our SslBump code with
the server certificate (that we then validate). Successful certificate
validation, in turn, may result in Squid splicing the connection, even
if OpenSSL detected other errors:

    noteNegotiationError: hold TLS write on FD 15 despite
    SQUID_TLS_ERR_CONNECT+TLS_LIB_ERR=2000068+TLS_IO_ERR=1

A spliced connection allows the TLS client to handle a legacy server the
way the client needs to handle it, without unwanted Squid meddling.

This is a Measurement Factory project.
@squidadm squidadm removed the backport-to-v7 maintainer has approved these changes for v7 backporting label Jan 16, 2026
@squidadm
Copy link
Collaborator

queued for backport to v7

kinkie pushed a commit that referenced this pull request Jan 17, 2026
Our TLS Server Hello parser does not treat legacy servers specially, but
enabling legacy server support in OpenSSL allows OpenSSL to advance
enough in its Server Hello processing to provide our SslBump code with
the server certificate (that we then validate). Successful certificate
validation, in turn, may result in Squid splicing the connection, even
if OpenSSL detected other errors:

    noteNegotiationError: hold TLS write on FD 15 despite
    SQUID_TLS_ERR_CONNECT+TLS_LIB_ERR=2000068+TLS_IO_ERR=1

A spliced connection allows the TLS client to handle a legacy server the
way the client needs to handle it, without unwanted Squid meddling.

This is a Measurement Factory project.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

M-merged https://github.com/measurement-factory/anubis#pull-request-labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants