Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed "callback failed" error message from tls_inspector.cc #240

Merged

Conversation

tedjpoole
Copy link
Contributor

The TLS inspector listener filter installs a servername callback (using SSL_CTX_set_tlsext_servername_callback()). That callback obtains the server name and then halts the handshake by returning SSL_TLSEXT_ERR_ALERT_FATAL. It does this because once it has obtained the server name, it has no need to progress the handshake any further because it's only "peeking" at the received data, and not actually doing the "real" handshake. In upstream envoy, on BoringSSL, this is OK, but on OpenSSL the SSL_TLSEXT_ERR_ALERT_FATAL return value causes a "callback failed" error message to be logged. It turns out this error message is innocuous, but it is unsightly and distracting, so this commit removes it by returning SSL_TLSEXT_ERR_OK instead.

The TLS inspector listener filter installs a servername callback (using
SSL_CTX_set_tlsext_servername_callback()). That callback obtains the server
name and then halts the handshake by returning SSL_TLSEXT_ERR_ALERT_FATAL.
It does this because once it has obtained the server name, it has no need
to progress the handshake any further because it's only "peeking" at the
received data, and not actually doing the "real" handshake. In upstream
envoy, on BoringSSL, this is OK, but on OpenSSL the SSL_TLSEXT_ERR_ALERT_FATAL
return value causes a "callback failed" error message to be logged. It turns
out this error message is innocuous, but it is unsigtly and distracting, so
this commit removes it by returning SSL_TLSEXT_ERR_OK instead.

Signed-off-by: Ted Poole <tpoole@redhat.com>
@tedjpoole tedjpoole requested review from jwendell and twghu and removed request for ggreenway July 24, 2024 19:53
Copy link
Member

@jwendell jwendell left a comment

Choose a reason for hiding this comment

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

I don't think this works.

Now I'm getting this error:

debug	envoy connection external/envoy/source/extensions/transport_sockets/tls/ssl_socket.cc:280	[Tags: "ConnectionId":"708"] remote address:10.244.0.19:46782,TLS_error:|268435709:SSL routines:OPENSSL_internal:NO_COMMON_SIGNATURE_ALGORITHMS:TLS_error_end	thread=30

It seems that we're just replacing the "callback error" with "NO_COMMON_SIGNATURE_ALGORITHMS".

@tedjpoole
Copy link
Contributor Author

We have always had this change in maistra/envoy going way back. We just hadn't copied it into envoy-openssl yet.

@tedjpoole tedjpoole merged commit b6d98a4 into envoyproxy:release/v1.28 Jul 25, 2024
5 checks passed
@tedjpoole tedjpoole deleted the fix-tls-inspector-cb-return branch July 25, 2024 12:06
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.

3 participants