Did OpenSSL 3.0 break Certbot?

Before reading @Osiris' post about the existing bug report , i was troubleshooting this from a Python perspective:

I don't think any of that would matter. That error gets triggered when Cryptography checks for FIPS support, and the underlying bindings don't have the right symbols.

Stuff like this usually means your bindings or core library are too old and don't meet the minimum version requirements. Most of the things you've posted suggest to me that you should be meeting these requirements. To be safe, I double checked the OpenSSL source - and they have had this for years in the various branches, so I am pretty sure it's not an issue with OpenSSL itself.

Looking at the history of Cryptography - in April of 2023 they migrated the fips detection to Rust.

It is possible the existing bug that Osiris found does not affect earlier releases. It very well might be affected in the same exact way - but the checks are completely different (see Move is_fips logic to Rust by alex · Pull Request #8822 · pyca/cryptography · GitHub) so I would not be surprised if you are able to use a version of Cryptography prior to that date.

So... I would try the following based on cryptography · PyPI releases as a potential stopgap solution:

pip install "cryptography==40.0.2"
3 Likes

If I understand the FreeBSD bugreport correctly, it's a linking problem. Thus recompiling with the correct linker "instructions" (I don't have that deep a knowledge about linking and stuff though) could fix it. Unfortunately the issue is with FreeBSD and how the compiler/linker/et c. is instructed, thus currently recompiling doesn't have any use indeed. But hopefully in the future it does.

3 Likes

Well there are two problems here:
1- The underling linking problem you discovered, which could potentially be fixed as you suggested
2- The Rust code will raise the exception as it checks for fips support due to the implementation details of that code. It is possible the previous python check will not raise an exception and simply determine fips is not supported. I didn't dig in too deep to that PR or the code that would invoke it, because I am lazy -- when I find stuff like that it's just way faster and easier to actually test the previous version than to visually audit the code for compatabilty.

3 Likes

Yes. It works!Many thanks!

2 Likes

Wow! I was hopeful it would, but unable to test. I'm glad it worked for you as a temporary fix until the upstream libraries are updated!

6 Likes

No, I'm not running docker, I'd rather switch to another client.

1 Like

It looks like there has been an update to Ports, see the earlier mentioned bug 273770.

Not sure which package was updated though.

1 Like
$ ldd /usr/local/lib/python3.9/site-packages/cryptography/hazmat/bindings/_rust.abi3.so
/usr/local/lib/python3.9/site-packages/cryptography/hazmat/bindings/_rust.abi3.so:
        libssl.so.111 => /usr/lib/libssl.so.111 (0x23728ce73000)
        libcrypto.so.111 => /lib/libcrypto.so.111 (0x23728efcd000)
        libthr.so.3 => /lib/libthr.so.3 (0x23728f94a000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x237291176000)
        libc.so.7 => /lib/libc.so.7 (0x23728a8dc000)

I was thinking the same. Bugger.

Thanks for your help, though. It's been good to bounce ideas off people with more of a clue than me!

1 Like

That confirms the incorrect linking. It should link to libssl.so.12 and libcrypto.so.12 apparently.

But as mentioned a few minutes ago, you could check out the bug report. One user mentions success with the current Ports. Although I'm not sure what has been updated exactly to get it fixed.

2 Likes

Hmm. FreeBSD 14.0 comes out in the next couple of days. I wonder if that will make a difference?

1 Like

Your post was interesting, and I did follow your links. But I don't have pip installed, and that's not the direction I want to go in. I'd like to solve the issue, not install some other competing packaging system.

I found Osiris' linking info much more interesting, and it also makes a lot more sense. I have just over two weeks for this linking issue to be solved before my cert expires :stuck_out_tongue_winking_eye:

Um... Can you explain that like I'm five? I'm honestly not sure what you mean.

What did you do? What did you revert to?

Sorry to be so thick, I've been having ongoing health issues (hence disappearing for over a week).

Did you revert to an older Python? Which version? How? Or an older Certbot? Or back to OpenSSL 1?

Over the last week, I even tried recompiling everything I had installed without success. I'd love to know what you did so I can do the same without breaking anything else!

I'm up to date with the current ports (last checked a couple of minutes ago) but still no luck :frowning:

cd /usr/ports/devel/py-pip && make install clean && pip install "cryptography==40.0.2"

I did so. And certbot worked fine.

3 Likes

Try the advice in the comment above. If that does not affect your Certbot version, try installing Certbot from the pip instructions and then - in the same virtualenv - pip install "cryptography==40.0.2"

ELI5: Cryptography changed how they check for that openssl flag in the next release, offloading it from Python into Rust. The Rust version tries to address the broken c library linking on every invocation to test for FIPs support, so it will always raise the exception. The earlier Python version does not seem to interact with the bindings like that, or catches the exception within Python, so you should be able to use it. There are two issues here - (i) the underlying bindings being broken, and (ii) the way that Python tests for this flag in Rust is broken as it has fatal errors if the bindings have issues. Downgrading does not fix the first (bigger) issue, but should avoid the second issue.

4 Likes

The problem is that your existing packaging system is broken due to incompatibilities and misconfigurations in their ports. IMHO, the only way to really fix this is by filing tickets with the maintainers for those packages (which already exist as @Osiris pointed out) – otherwise you'll be doing a lot of work to either (i) fix the port and risk that being overwritten by an update or potentially breaking other software that relies on it, or (ii) correctly compile and install a dedicated version of OpenSSL, Python, the bindings, and Certbot/etc that are all built against each other in their own sandboxed environment.

The easiest and most lasting fix, IMHO, will be to use install Certbot via pip and then reinstall an earlier version of the cryptography package. Because certbot and cryptography will be installed by pip into their own virtualenv, they won't update/upgrade without your explicit interaction and should be immune from any distribution upgrades.

5 Likes

You should be able to get a cert manually.
That would, at least, reset the expiration counter back to 90 days :wink:

2 Likes

Thank you so much! That worked for me too :grinning:

I'm still a little wary of using third party installers, but that was pretty painless, and I know I can remove the package and pip whenever I want.

Also, I really appreciate your input @Osiris and @jvanasco , the links were very informative and (at least partially) explained dlsumy's solution.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.