Jenkins does not use username and password for basic auth
Overview
The Jenkins CI service webhook does not utilise the username and password provided in the settings page for basic auth against a Jenkins instance.
Reproduce
- Enable the Jenkins service on a new non-empty repository
- Fill in all required details
- Jenkins url: http://test.mrchris.me:8080
- Username: test
- Password: test
- On the host run
sudo nc -l 8080
- Click "Test settings"
Actual
No basic auth headers are sent in the request
root@gitlab-latest-us:~# nc -l 80
POST /project/test_project HTTP/1.1
Content-Type: application/json
X-Gitlab-Event: Push Hook
Connection: close
Host: test.mrchris.me
Content-Length: 1747
Expected
Username and password are sent in the authentication headers.
Workaround
Placing the username and password in Jenkins url field will force the hook to use basic auth. Example: http://test:test@test.mrchris.me