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

GIT-2927: Fixed lack of updates to trusted CA lists (Fixes #2927) #3006

Merged
merged 2 commits into from
Dec 17, 2021

Conversation

KH-Amir-TN
Copy link
Contributor

@KH-Amir-TN KH-Amir-TN commented Dec 10, 2021

Description

Many users had experienced some connectivity error with external services.
The error log is "OpenSSL::SSL::SSLError (SSL_connect returned=1 errno=0 state=error: certificate verify failed (unable to get local issuer certificate))" which indicates that an HTTPS connection was closed because of a fail during x509 certificate verification.
The issues cause is the expiration of the DST Root CA X3 Let's encrypt root certificate.
As mentioned here Let's encrypt has also a newer Root certificate ISRG Root X1 which after the expiration of DST becomes the only valid certificate.

Greenlight (GL) requires the use of http client to use some external services (BigBlueButton,OmniAuth providers,...).
Some gems (dependencies) in the GL application simplifies the communication with external APIs and comes with their own dependencies.
Some of which depends on faraday and others on httpclient.
The faraday gem has faraday-net_http which is the adapter to the Net::HTTP that is used for example by the bigbluebutton-api-ruby.
The faraday adapter by default uses the OpenSSL::X509::Store as its default store to trusted CA list.
This raises an issue for some of the users who use an old docker image since their Openssl trusted root certificates is old which leads any https connection to any server (including but not limited to BigBlueButton servers) with a x509 certificate issued by Let's encrypt to break.
Second issue happens for another subset of users who may have an up to date openssl CA list but still experience some problems (including but not limited to OmniAuth),this subset may have a problem because of the httpclient gem that uses an old (from 2015) Mozilla CA list.

Testing Steps

  1. Checked all the http client gems and the gems that depends on it.
  2. Tested each http client gem in isolation.
  3. Found hat HTTPClient by default loads the cacert.pem [on non JRuby runtimes] (the default in the repo is outdated) included in its lib/httpclient and falls back if configured to the OpenSSL store but any update in execution to its stores won't have an effect because it cashes it on runtime.
  4. Found that Faraday adapter to Net::HTTP uses the OpenSSL as its store by default and cashes it on runtime.

Solution

For HTTPClient: we fetch the latest Mozilla cacert.pem securely on docker image build.
For Net::HTTP: we enforce the update of the openssl certs on image build.

Screenshots (if appropriate):

@KH-Amir-TN KH-Amir-TN linked an issue Dec 10, 2021 that may be closed by this pull request
@farhatahmad farhatahmad added this to the 2.11 milestone Dec 17, 2021
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@farhatahmad farhatahmad merged commit 76a2e11 into bigbluebutton:master Dec 17, 2021
thifranc pushed a commit to thifranc/greenlight that referenced this pull request Dec 27, 2021
@sripathroy
Copy link

Migration from Greenlight Customized 2.5 to Greenlight 3 Failed

Steps done

rake Migration tasks file was added
While migrating users got this error
OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (certificate has expired)

RUBY_VERSION=2.5.1
RUBYGEMS_VERSION=2.7.7
BUNDLER_VERSION=1.16.6
VERSION_CODE=v2

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

Successfully merging this pull request may close these issues.

Greenlight doesn't handle the Let's Encrypt CA switch
3 participants