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

SSL errors occurred: The certificate has expired #919

Closed
ghost opened this issue Oct 1, 2021 · 14 comments
Closed

SSL errors occurred: The certificate has expired #919

ghost opened this issue Oct 1, 2021 · 14 comments
Assignees
Milestone

Comments

@ghost
Copy link

ghost commented Oct 1, 2021

VERSION / OS / ENVIRONMENT
LibrePCB Version: 0.1.6-rc1
Git Revision:     32a1097
Build Date:       2021-09-30T11:36:43
Qt Version:       5.14.2 (built against 5.14.2)
CPU Architecture: x86_64
Operating System: Debian GNU/Linux 10 (buster)
Platform Plugin:  xcb
LibrePCB Version: 0.2.0-unstable
Git Revision:     6c6ba1f
Build Date:       2021-09-25T09:43:02
Qt Version:       5.14.2 (built against 5.14.2)
CPU Architecture: x86_64
Operating System: Debian GNU/Linux 10 (buster)
Platform Plugin:  xcb
SUMMARY

LibrePCB can't load libraries via "Library Manager"

STEPS TO REPRODUCE
  1. Launch LibrePCB;
  2. Open "Library Manager"
  3. See error message.
EXPECTED RESULTS

"Library Manger" should work without issues.

ACTUAL RESULTS

"Library Manager" does not work due to next issue:

SSL errors occurred:

The certificate has expired

ADDITIONAL INFORMATION

Screenshot_2021-10-01_11-52-06

Screenshot_2021-10-01_12-05-28

@ubruhin
Copy link
Member

ubruhin commented Oct 1, 2021

That's very bad 😭 But I don't understand yet why this happens, actually the certificate of api.librepcb.org looks valid. Maybe it's somehow related to the OpenSSL library bundled within the AppImage 🤔 At least I can't reproduce this problem when building LibrePCB from sources.

@ubruhin ubruhin self-assigned this Oct 1, 2021
@ubruhin ubruhin added this to the 0.1.6 milestone Oct 1, 2021
@ghost
Copy link
Author

ghost commented Oct 1, 2021

Maybe it's somehow related to the OpenSSL library bundled within the AppImage

Take a look on next issues:

As side note, does OpenSSL really needed to be included in AppImage? Why just not left its outside and lets LibrePCB-*.AppImage would use installed openssl package on each distro instead?

@ghost
Copy link
Author

ghost commented Oct 1, 2021

At least I can't reproduce this problem when building LibrePCB from sources.

What Linux distro you use? I use Debian, and there are some default path may be differ from Ubuntu or other dstros.

@ubruhin
Copy link
Member

ubruhin commented Oct 1, 2021

I think I have found the reason for this problem. Older OpenSSL library versions do no longer work with recent Let's Encrypt certificates: https://community.letsencrypt.org/t/openssl-client-compatibility-changes-for-let-s-encrypt-certificates/143816

There seem to be a server-side workaround available, but I do not understand yet how to implement this workaround exactly. I'm working on it... In the worst case (if the workaround doesn't work) I think we have to create a new LibrePCB release.

As side note, does OpenSSL really needed to be included in AppImage? Why just not left its outside and lets LibrePCB-*.AppImage would use installed openssl package on each distro instead?

That's a good question. Of course this avoids the dependency to OpenSSL, but as we see now, bundling also leads to problems 🙈

Btw, our Windows builds are still working so probably only our Linux binaries (and maybe macOS?) are affected by this issue.

@ghost
Copy link
Author

ghost commented Oct 1, 2021

Btw, our Windows builds are still working so probably only our Linux binaries

Does Windows builds also include same OpenSSL version as it bundled into AppImage?

Also, take a look here — Windows may be affected too:

@ubruhin
Copy link
Member

ubruhin commented Oct 1, 2021

I think I could fix it server side! 🚀 @Symbian9 can you confirm it is working on your setup as well?

However, it's just a temporary workaround. Now we should think about how to avoid such issues in the future.

@ghost
Copy link
Author

ghost commented Oct 1, 2021

can you confirm it is working on your setup as well?

Confirmed!

pic

@ghost
Copy link
Author

ghost commented Oct 1, 2021

Now we should think about how to avoid such issues in the future.

For any AppImage specific help:

@dbrgn
Copy link
Member

dbrgn commented Oct 3, 2021

I think I could fix it server side!

What did you change?

@ubruhin
Copy link
Member

ubruhin commented Oct 3, 2021

What did you change?

I switched to the alternate certificate chain as explained in https://community.letsencrypt.org/t/openssl-client-compatibility-changes-for-let-s-encrypt-certificates/143816.

@ubruhin
Copy link
Member

ubruhin commented Oct 12, 2021

So after thinking a bit about this, I propose to do the following:

  • Update CI environment to bundle a much more recent OpenSSL version with our binary releases, and try to keep it up to date in future.
  • Show the OpenSSL library version in the "About LibrePCB" dialog (tab "Details") to make it much easier to verify if the version is sufficient and bundling worked properly (it's known only at runtime, we can't assert for the OpenSSL library at compile time).
  • Keep the alternate certificate chain for api.librepcb.org for quite some more time to avoid breaking LibrePCB <= 0.1.5 again.

So far I do not have any better idea. Unbundling OpenSSL is not really an option since then we couldn't ensure that the used OpenSSL version is compatible with the Qt version. So I think we really have to bundle it.

I also thought about using HTTP+signatures instead of HTTPS (like APT does), but I think this would be overkill and not worth the effort...

I'll close this issue since the current problem is fixed for now, and I'll open PRs to apply the suggested changes. Feel free to reopen if one does not agree.

@dbrgn
Copy link
Member

dbrgn commented Oct 12, 2021

Unbundling OpenSSL is not really an option since then we couldn't ensure that the used OpenSSL version is compatible with the Qt version.

This is only for our AppImage binary releases, right?

Keep in mind: This means we should probably publish new builds if there are any critical OpenSSL vulnerabilities being published (affecting the version we are bundling).

@ubruhin
Copy link
Member

ubruhin commented Oct 12, 2021

This is only for our AppImage binary releases, right?

No, it's for all binaries. Windows, Linux, macOS; Installers, archives and AppImages.

Keep in mind: This means we should probably publish new builds if there are any critical OpenSSL vulnerabilities being published (affecting the version we are bundling).

That's what I meant with "[...] and try to keep it up to date in future.". However, I don't think we have to create new LibrePCB releases each time a new vulnerability is known since LibrePCB is not a security critical application like a web browser. The API is accessed only rarely and supports only a very limited set of features. Also the downloaded libraries are not confidential at all (thus I thought about even using HTTP instead of HTTPS). So IMHO it would be totally fine to just update OpenSSL when we create a new release anyway. Yes, this opinion might be different to yours 😉

@dbrgn
Copy link
Member

dbrgn commented Oct 12, 2021

Sure, with "critical" I mean "critical with regards to LibrePCB". That's probably a small subset of vulnerabilities. And yes, libraries are most probably not critical at all, but projects (being sent to the ordering API) might be. (Although people with sensitive projects will probably not upload them to some ordering API, so this is not very realistic 😉)

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

No branches or pull requests

2 participants