GitLab Composer Repository SSL operation failed on gitlab-runner

Summary

When using a private composer repository hosted on gitlab, the docker runner is failing to verify the certificate like so :

$ COMPOSER_MEMORY_LIMIT=-1 SYMFONY_ENV=test composer install --optimize-autoloader --no-interaction --dev --no-progress --prefer-dist --no-suggest
Do not run Composer as root/super user! See https://getcomposer.org/root for details
You are using the deprecated option "dev". Dev packages are installed by default now.
Loading composer repositories with package information
                                                                                                                                                                             
  [Composer\Downloader\TransportException]                                                                                                                                   
  The "https://<privategitlabinstance.org>/api/v4/group/<id>/-/packages/composer/packages.json" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:  
  error:14007086:SSL routines:CONNECT_CR_CERT:certificate verify failed                                                                                                      
  Failed to enable crypto                                                                                                                                                    
  failed to open stream: operation failed                                                                                                                                    
                                                                                                                                                                             
install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--] [<packages>]...
ERROR: Job failed: exit code 1

Steps to reproduce

What is the current bug behavior?

What is the expected correct behavior?

Relevant logs and/or screenshots

image image

Possible fixes

I've found another issue that could be related, but i'm not really sure : gitlab-runner#4868 (closed)

Edited by 🤖 GitLab Bot 🤖