Unable to create custom domain without a certificate via API
Problem to solve
Unable to create custom domain without a certificate via API, due to the impossibility of disabling the HTTPS-only setting
Further details
On the web UI of gitlab pages sections, you are capable of creating a new custom domain without a certificate, disabling the Force domains with SSL certificates to use HTTPS checkbox. In this way, later you can specify a custom domain name without the need of adding a certificate.
BUT, this is not possible using the API. If you call the api without specify a certificate you will get a:
{"message":{"certificate":["must be present if HTTPS-only is enabled"],"key":["must be present if HTTPS-only is enabled"]}}
Proposal
Add someway to change this HTPPS-only setting via API. Or add another parameter on the create new pages domain, to disable at the same time that custom domain is created
What does success look like, and how can we measure that?
You would be able to make a call like this (I have removed the '--form "certificate=$CERT_PEM" --form "key=$KEY_PEM"' part:
curl --request POST --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" --form "domain=www.domain.example" https://gitlab.example.com/api/v4/projects/5/pages/domains
and obtain a success instead of a 400 error
