Page MenuHomePhabricator

Download of composer cweiske/php-sqllint requires to disable https security
Closed, ResolvedPublic

Description

To lint SQL files (T132641) the labs/tools/heritage added a composer dependency upon cweiske/php-sqllint. That downloads the package from git://git.cweiske.de/php-sqllint.git which is not a secure protocol. Hence compose bails out:

$ composer require cweiske/php-sqllint
...
  - Installing cweiske/php-sqllint (v0.1.3)
    Cloning ad7dac068d29c9bd9b07c4e908914448950aec30

Installation failed, deleting ./composer.json.

                                                                               
  [Composer\Downloader\TransportException]                                     
  Your configuration does not allow connections to git://git.cweiske.de/php-s  
  qllint.git. See https://getcomposer.org/doc/06-config.md#secure-http for de  
  tails.                                                                       

The git.cweiske.de respond to https with a certificate from Let's Encrypt. Unfortunately the name is mail.cweiske.de.

$ openssl s_client -showcerts -servername git.cweiske.de -connect git.cweiske.de:443
Certificate chain
 0 s:/CN=mail.cweiske.de
   i:/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3
 1 s:/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3
   i:/O=Digital Signature Trust Co./CN=DST Root CA X3


Server certificate
subject=/CN=mail.cweiske.de
issuer=/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3

We want to reach out to the host to:

  • get a valid certificate on git.cweiske.de
  • expose the git repositories over https
  • update packagist :}

Then we can remove the composer option in https://gerrit.wikimedia.org/r/#/c/315226/2/composer.json

Event Timeline

I'm reaching out to inform the host.

Makes sense. Thanks @hashar for flagging this and @Lokal_Profil for trackling this :)

@Lokal_Profil I filled this task and then sent him an email. It seems you did the same, at worse he will get two emails :-}

Got a reply from the author Christian Weiske:

However on packagist.org it is registered with the git protocol which
cause composer to complain because it is not secure (for good reason):

I've added HTTPS cloning support to my git repositories and changed the
php-sqllint repository on packagist.

And indeed:

$ composer info cweiske/php-sqllint|grep source
source   : [git] https://git.cweiske.de/php-sqllint.git 
                 ^^^^^

git.cweiske.de now has a certificate name with the proper server name:

$ openssl s_client -showcerts -servername git.cweiske.de -connect git.cweiske.de:443
Certificate chain
 0 s:/CN=git.cweiske.de
   i:/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3
1 s:/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3
   i:/O=Digital Signature Trust Co./CN=DST Root CA X3

Server certificate
subject=/CN=git.cweiske.de
issuer=/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3

Change 328914 had a related patch set uploaded (by Hashar):
composer: enable secure http

https://gerrit.wikimedia.org/r/328914

Change 328914 merged by jenkins-bot:
composer: enable secure http

https://gerrit.wikimedia.org/r/328914

hashar claimed this task.

Aced!