As the titles says. I'm starting to add Service Workers to a site, and in order to work they require a valid SSL cert. I've had my local dev server delivering over https with a self-signed cert for a while, albeit with Chrome giving the "Not secure" message that I've just been ignoring until now. I've seen a lot of similar questions on here (using localhost), but nothing matching my exact setup (using virtual hosts on localhost), and nothing I've tried has worked.
I'll describe my setup:
openssl req –x509 –nodes -sha256 –days 3650 –newkey rsa:2048 –keyout michael.domain1.key –out michael.domain1.crt -subj "/C=US/ST=Michigan/L=SomeCity/O=CompanyName/OU=Dev/CN=michael.domain1.com"
In Chrome Dev Tools Security tab, I have two errors:
Thank you.
I finally got it! This somewhat buried comment by Drakes is what helped me generate proper cert files using a .sh file. I'm not exactly sure what did it for me in the end, but I did end up with slightly different named files than I had before. I now have michael.domain1.com.cer instead of michael.domain1.cer. The new cert file fixed the Subject Alternative Name Missing and the ERR_CERT_COMMON_NAME_INVALID errors in Chrome Dev Tools Security tab, but I did have a new error about it being an untrusted authority. I then imported the same file a couple different ways into the Trusted Root Authority using both Windows and Chrome itself (you can import them from Chrome under Settings > Advanced > Manager certificates > Import). After I rebooted Apache one final time and closed and reopened Chrome, everything worked.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With