Running commands on Travis CI before composer self-update runs

I have the following .travis.yml file:

language: php

    - php: 5.3
      dist: precise

  - wget --no-check-certificate
  - echo "openssl.cafile=~/cacert.pem" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini

The problem is that when it runs I get the following error:

  The "" file could not be downloaded: SSL op  
  eration failed with code 1. OpenSSL Error messages:                          
  error:14090086:SSL routines:func(144):reason(134)                            
  Failed to enable crypto                                                      
  failed to open stream: operation failed

As I understand it that error means that the cert on the website couldn’t be validated. No doubt because my CA certs are too old. I’m doing wget --no-check-certificate and echo "openssl.cafile=~/cacert.pem" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini in before_install BUT it’s still being ran after Travis CI does composer self-update.

Any ideas how I can get the above commands to run before comoposer self-update instead of after?

Also, yes, I’m aware PHP 5.3 has been EOL for years. That doesn’t invalidate my question.