I’m using CloudFlare with “Full ssl (strict)” option. I have a primary domain with separate COMODO ssl installed.
Then i have installed Let’s Encrypt. And issued a certificate for my subdomain. But that doesn’t work. Cloadflare gives me an error: “Invalid SSL sertificate”.
I think, i have used this command: certbot -i apache -a webroot -w /var/www/html/sub.domain.com/public_html -d sub.domain.com
contact CloudFlare to see why they think that the subdomain certificate is invalid? Otherwise if you are comfortable with OpenSSL you should be able to review your configurations from the server itself using localhost.
Full SSL (Strict): secure connection between the visitor and Cloudflare, and secure and authenticated connection between Cloudflare and your web server. You will need to have your server configured to answer HTTPS connections, with a valid SSL certificate. This certificate must be signed by a certificate authority, have an expiration date in the future, and respond for the request domain name (hostname).
Thank you for your tips. I have tried this command and it returned same results like yours.
I have one free domain, i will try to park it on my server and then i will issue SSL sertificate for it. It will be more easy to test it without CloadFlare.
you can choose how cloudflare deals with each subdomain
a quick test is to turn of full protection and test the original server using ssllabs.com
This will identify any issues. You can then turn the full encryption back on once you have fixed the issue
below is a screenshot of the alpha subdomain (fully proxied by cloudflare) and beta subdomain (not proxied) the certificate for both is the same. You can do openssl and ssllabs.com test on both
These are i believe what are called snake oil certificates (self signed and auto generated)
Turn cloudflare proxying back on but step it down to Full SSL (self signed certs ok)
Create a VHOST file for the HTTP version of your site only (create file in sites-available and use a2ensite. https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-14-04-lts)
Run certbot apache (this should pickup the host name)
Create the certificate
Check (and be very careful that the certificate for the domain is a let’s encrypt one)
Turn on Strict Mode in CloudFlare
I suggest using this approach to give you maximum time to achieve what you want without impacting security (hence the recommendation about turning Full SSL on but not the strict mode)
@schoen - will a HTTPS virtual-host be automatically created?
(recalling that you do need that -a webroot if you're already behind CloudFlare; -a apache or --apache don't work behind a CDN)
You don't need to have an existing HTTPS VirtualHost to use Certbot (either with --apache or with -i apache), and it will create one for you if you don't have one. It creates it based on your matching HTTP VirtualHost.
Yes, Apache behind a CDN is a pretty good use case for that combination.
The reason that -a apache is nice is that you don’t have to specify any more configuration and even if you don’t have a webroot at all (like if your web server redirects everything to a web application and doesn’t serve any static files from the filesystem!), that’s still OK. But since -a apache doesn’t work behind CDNs, the -a webroot -i apache combination is a good one in that case.
webroot in turn has more prerequisites, but is also a bit easier to debug.