WolfSSL Sucks Too, So Now What? – Makefile.feld

WolfSSL Sucks Too, So Now What? – Makefile.feld

OpenSSL’s Woes: Why WolfSSL is Falling Short on TLS 1.3 Compliance

In the ever-evolving landscape of cryptographic libraries, OpenSSL has long been the de facto standard. However, recent developments have cast a shadow over its dominance, with forks like BoringSSL and AWS-LC raising concerns about their commitment to broader use cases. Meanwhile, GnuTLS and LibreSSL have their own sets of challenges, leaving developers in a quandary when it comes to choosing a reliable TLS implementation.

The Haproxy Revelation

Last year, Haproxy published a revealing article about the performance issues plaguing OpenSSL. This sparked a renewed interest in alternative TLS libraries, with WolfSSL emerging as a potential contender. The idea was simple: package Haproxy with WolfSSL to provide users with a faster, more efficient SSL/TLS stack. While this approach gained some traction on platforms like FreeBSD, it hasn’t seen widespread adoption on mainstream Linux distributions.

The WolfSSL Bug

As developers began experimenting with WolfSSL-backed Haproxy, a critical bug surfaced. Initially dismissed, the issue resurfaced, prompting a deeper investigation. The root cause? WolfSSL’s handling of TLS 1.3 and its compatibility with middleboxes.

TLS 1.3 and Middlebox Hell

TLS 1.3, defined in RFC 8446, introduced significant changes from its predecessor, TLS 1.2. However, these changes brought about a new set of challenges, particularly with middleboxes—those notorious network devices that can tamper with traffic without your knowledge.

To address this, the TLS 1.3 authors introduced the Middlebox Compatibility Mode. This feature allows clients to optionally set a non-empty session ID in the ClientHello to fool middleboxes, while also exchanging dummy change_cipher_spec records. Although this adds latency, it ensures compatibility with older network infrastructure.

WolfSSL’s Non-Compliance

Despite the clear guidelines in RFC 8446, WolfSSL has taken a different approach. The entire middlebox compatibility functionality is gated behind the -DWOLFSSL_TLS13_MIDDLEBOX_COMPAT flag, forcing users to choose between full compliance and non-compliance. This decision has far-reaching implications, particularly for applications that rely on strict adherence to RFC standards.

The Impact on Erlang/Elixir

One of the most notable victims of WolfSSL’s non-compliance is the Erlang/OTP ecosystem. Erlang’s SSL library, influenced by Joe Armstrong’s philosophy of “Make it work, then make it beautiful, then if you really, really have to, make it fast,” opted to enable middlebox compatibility by default. This decision, while cautious, has led to compatibility issues with WolfSSL-backed HTTPS servers when TLS 1.3 is available.

The Path Forward

Given these challenges, some experts argue that the community should refocus its efforts on LibreSSL, which, despite its own set of issues, offers a more reliable and RFC-compliant alternative. As Haproxy noted, LibreSSL’s earlier fork from OpenSSL spared it from some of the performance issues plaguing newer versions, making it a viable option for many use cases.

Conclusion

The saga of WolfSSL and its handling of TLS 1.3 serves as a cautionary tale for developers. While the pursuit of performance and efficiency is commendable, it should not come at the cost of compliance and reliability. As the cryptographic landscape continues to evolve, it’s crucial to prioritize standards and interoperability to ensure a secure and seamless user experience.


Tags:

  • OpenSSL
  • WolfSSL
  • TLS 1.3
  • Middlebox Compatibility
  • Erlang/OTP
  • Haproxy
  • RFC 8446
  • Cryptographic Libraries
  • Network Security
  • SSL/TLS

Viral Sentences:

  • “WolfSSL’s non-compliance with RFC 8446 is a ticking time bomb for developers.”
  • “Middlebox hell is real, and WolfSSL is making it worse.”
  • “Erlang/OTP’s cautious approach to TLS 1.3 is a lesson in prioritizing reliability over speed.”
  • “LibreSSL might be the unsung hero we need in the world of cryptographic libraries.”
  • “The quest for faster TLS termination shouldn’t compromise security and compliance.”

,

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *