Browse Source

Attempt workaround for repo.packagist.org domain SSL on very old PHP, fixes #7530

Jordi Boggiano 6 years ago
parent
commit
e7a9bd3362
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/Composer/Util/RemoteFilesystem.php

+ 3 - 0
src/Composer/Util/RemoteFilesystem.php

@@ -761,6 +761,9 @@ class RemoteFilesystem
 
                 $tlsOptions['ssl']['CN_match'] = $certMap['cn'];
                 $tlsOptions['ssl']['peer_fingerprint'] = $certMap['fp'];
+            } elseif (!CaBundle::isOpensslParseSafe() && $host === 'repo.packagist.org') {
+                // handle subjectAltName for packagist.org's repo domain on very old PHPs
+                $tlsOptions['ssl']['CN_match'] = 'packagist.org';
             }
         }