# Openssl 3.x speed issues

**URL:** <https://discourse.haproxy.org/t/openssl-3-x-speed-issues/8494>\
**Category:** Help!\
**Created:** [March 13, 2023, 5:04pm UTC](https://discourse.haproxy.org/t/openssl-3-x-speed-issues/8494 "2023-03-13T17:04:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![inigo78](https://avatars.discourse-cdn.com/v4/letter/i/e19adc/32.png) [@inigo78](https://discourse.haproxy.org/u/inigo78)\
**Post date:** [March 13, 2023, 5:04pm UTC](https://discourse.haproxy.org/t/openssl-3-x-speed-issues/8494/1 "2023-03-13T17:04:33Z")

</div>

Hi,

We’re having issues upgrading from ubuntu 20.04 to ubuntu 22.04.

After test different haproxy versions (the one shipped by ubuntu, 2.4, and 2.7.3) and different openssl versions (the one shipped by ubuntu, 3.0.2, and 3.0.7) we always see blocking issues in the TLS handsake under high load.

Same configuration, ubuntu 20.04 with OpenSSL 1.1.1, no problem at all.

¿any hints?

---

<div class="post-metadata">

**Author:** ![lukastribus](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lukastribus](https://discourse.haproxy.org/u/lukastribus)\
**Post date:** [March 13, 2023, 5:10pm UTC](https://discourse.haproxy.org/t/openssl-3-x-speed-issues/8494/2 "2023-03-13T17:10:04Z")

</div>

Unfortunately there is no solution, other than to downgrade. Openssl 3.0 is extremely problematic for multi-threading loads, this has nothing to do with haproxy but with changes within openssl 3.0 itself, please see:

> <https://github.com/openssl/openssl/issues/17627#issuecomment-1060123659>
>
> Performance problems encountered with 3.0 should be mentioned here.

As well as:

[https://www.mail-archive.com/haproxy@formilux.org/msg42992.html](https://www.mail-archive.com/haproxy@formilux.org/msg42992.html)

---

<div class="post-metadata">

**Author:** ![inigo78](https://avatars.discourse-cdn.com/v4/letter/i/e19adc/32.png) [@inigo78](https://discourse.haproxy.org/u/inigo78)\
**Post date:** [March 14, 2023, 11:07am UTC](https://discourse.haproxy.org/t/openssl-3-x-speed-issues/8494/3 "2023-03-14T11:07:19Z")

</div>

Yes, exactly what we saw.

If we were about to test the today release of openssl, which introduces locking/performance ([0]) improvements… do we need to compile haproxy against the new openssl? or it’s enough if we substitute the operative system openssl and libssl? (haproxy -vv shows it’s compiled against openssl 3.0.2)

[0] [OpenSSL 3.1 Final Release - OpenSSL Blog](https://www.openssl.org/blog/blog/2023/03/07/OpenSSL3.1Release/)

---

<div class="post-metadata">

**Author:** ![lukastribus](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lukastribus](https://discourse.haproxy.org/u/lukastribus)\
**Post date:** [March 14, 2023, 12:30pm UTC](https://discourse.haproxy.org/t/openssl-3-x-speed-issues/8494/4 "2023-03-14T12:30:10Z")

</div>

Replacing a system openssl library is a bad idea as it could break other applications on the system.

I suggest you build haproxy with a static openssl build, as per `4.5) Cryptography` in the INSTALL file in the tarball.

---

<div class="post-metadata">

**Author:** ![amit777](https://avatars.discourse-cdn.com/v4/letter/a/e99b99/32.png) [@amit777](https://discourse.haproxy.org/u/amit777)\
**Post date:** [April 17, 2023, 1:18am UTC](https://discourse.haproxy.org/t/openssl-3-x-speed-issues/8494/5 "2023-04-17T01:18:07Z")

</div>

Hi, out of curiosity, do you load any directories that contain many SSL certificates? If so, are any of those certificates expired? We had a ton of issues similar to what you are describing, and we stumbled onto something that helped… deleting the expired certificates from the folder, and then restarting HAproxy seemed to fix the issues for us! I have no idea why this would would work.

we are actually going to just move to debian11. Don’t want to deal with openssl 3.0 issues until it’s more mature.
