By default, 000webhost provides a secure connection for all 000webhostapp.com subdomains. However, for custom domains, this is not the case. But with this method, you can setup your custom domain with a secure HTTPS connection for free.
First, sign up for an account at https://000webhost.com if you don't already have one.
Then, create a site, picking a name and a password.
Now, create a Cloudflare account at https://www.cloudflare.com/a/sign-up
Next, add your domain in the text box, and click "Scan DNS Records".
Watch the video as the system collects your current DNS records, then add any missing records. Then click continue.
Verify that all of your current records are shown, then click continue again.
Select the "Free Website" option and click continue.
Take note of your current name servers, and change them to the name servers listed.
Then click continue.
Wait up to 24 hours for name server changes to take place, and recheck name servers every few hours.
When name servers have been changed, you should be able to refresh the page and see something similar to the image below.
Next, go to the "Crypto" tab of your Cloudflare dashboard. Make sure "SSL" is set to flexible.
Now, go to the "DNS" tab of your Cloudflare dashboard. Add the two cname records for your 000webhost free site, as seen in the "My Domains" section of your Control Panel. The cname records that you need to add are below.
"@" points to "yoursite.000webhostapp.com"
"www" points to "yoursite.000webhostapp.com"
"yoursite" needs to be replaced with your website name. And don't use quotes. The "@" and "www" go in the "name" section when adding the records, and the 000webhostapp URL goes in the "Domain name" section.
Make sure that the orange cloud is turned off, or otherwise 000webhost will not accept your domain name.
Then, add your domain in your Control Panel, allowing a few minutes for DNS to propagate.
Once it has been added to your 000webhost panel, go back to Cloudflare and turn the orange cloud on. This will enable the SSL.
Then, simply design your website and add HTTPS in front of your domain when accessing your site. Simple as that.
If you want to check and make sure that Cloudflare SSL is working, you can visit https://test-cloudflare.ga and https://status.test-cloudflare.ga
Here's a video tutorial.