We set up Cloudflare for SSL, then the https URL starts working but HTTP is working as well (ie does not redirects to https) and this affects the SEO of our website.

for redirect to https we are write code on our virtual host or .htaccess but cloudflare also provide option to redirect all urls to https.

Here you get solution for how to setup “Always Use https URL” in cloudflare.