For anyone looking here. First check you have a cert for the gitlab instance in your Truststore. If not import it:
keytool --list ---keystore /etc/ssl/certs/java/cacerts --storepass <password>
keytool -importcert -cacerts -storepass <password> -alias gitlab.<yourdomain> -file /etc/ssl/certs/gitlab.crt
I then had to change my sonar.properties, see the COMPUTE ENGINE section:
sonar.ce.javaOpts=-Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Djavax.net.ssl.trustStore=/etc/ssl/certs/java/cacerts -Djavax.net.ssl.trustStorePassword=<password>
After restarting the server, the problem is resolved, in my case on Ubuntu:
service sonarqube restart