Skip to content

Outgoing HTTPS connections fail with OpenSSL 3.2+ #11465

Closed

Description

@maskit

ATS fails to establish outgoing HTTPS connections if it uses OpenSSL 3.2+.

SocketManager::sendto() returns EINVAL (22) because ats_ip_size(dst) returns 0 here.

const sockaddr *dst = reinterpret_cast<const sockaddr *>(BIO_get_data(bio));
Metrics::Counter::increment(net_rsb.fastopen_attempts);
err = SocketManager::sendto(fd, (void *)in, insz, MSG_FASTOPEN, dst, ats_ip_size(dst));

Workaround:

diff --git a/src/iocore/net/SSLNetVConnection.cc b/src/iocore/net/SSLNetVConnection.cc
index 4d0e2d9a2..b088026bf 100644
--- a/src/iocore/net/SSLNetVConnection.cc
+++ b/src/iocore/net/SSLNetVConnection.cc
@@ -209,6 +209,9 @@ SSLNetVConnection::_make_ssl_connection(SSL_CTX *ctx)
   if (likely(this->ssl = SSL_new(ctx))) {
     // Only set up the bio stuff for the server side
     if (this->get_context() == NET_VCONNECTION_OUT) {
+      SSL_set_fd(ssl, this->get_socket());
+
+#if !defined(BIO_SOCK_TFO)
       BIO *bio = BIO_new(const_cast<BIO_METHOD *>(BIO_s_fastopen()));
       BIO_set_fd(bio, this->get_socket(), BIO_NOCLOSE);
 
@@ -217,6 +220,7 @@ SSLNetVConnection::_make_ssl_connection(SSL_CTX *ctx)
       }
 
       SSL_set_bio(ssl, bio, bio);
+#endif
     } else {
       this->initialize_handshake_buffers();
       BIO *rbio = BIO_new(BIO_s_mem());

Activity

  1. zwoop commented on Jun 20, 2024

    @zwoop
    Contributor

    This seems like a priority for v10.0.0

  2. added this to the 10.0.0 milestone on Jun 24, 2024
  3. moved this to Blockers for 10.0.0 in ATS v10.0.xon Jun 24, 2024
  4. ywkaras commented on Jun 25, 2024

    @ywkaras

    Verified the problem on Ubuntu. The tls_verify Au test fails.

  5. bryancall commented on Jul 1, 2024

    @bryancall
    Contributor

    I am seeing the same issue on Fedora 40

  6. ywkaras commented on Jul 2, 2024

    @ywkaras

    It looks like the problem is a consequence of the f_tcp_fastopen option not set:

    if (this->options.f_tcp_fastopen) {

  7. linked a pull request that will close this issueFix for OpenSSL 3.2+. #11501on Jul 2, 2024
  8. moved this from Blockers for 10.0.0 to Done in ATS v10.0.xon Jul 16, 2024
  9. Cyborgscode commented on Nov 14, 2024

    @Cyborgscode

    @jeredfloyd backport fix works. Tested on production system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions