I'm learning about certificates, HTTPS together and after 4 days I'm out of idea how to set up to become trusted. In my lab env. I have a Windows server with a CA role.
Previously I installed a VM-Dell OpenManage for my server. It has a graphical interface for requests and an import certificate for HTTPS access. I successfully generated a Certificate Signing Request and get a cert from my windows CA server (https://x.x.x.x/certsrv/) It was done under 2 min.
I thought I can try this, on an apache2 webserver (Ubunut20.04). Well, now I am stuck and still don't know how to get it to work.
1. Currently (after ~50 openssl req) I requested certificate with these commands:
openssl req -new -newkey rsa:2048 -nodes -addext “subjectAltName = DNS:*.mydomain.local” -keyout serverkey.key -out serverreq.csr
2. I opened my windows CA server from browser https://x.x.x.x/certsrv/ and Request Certificate-->Advanced Certificate Request-->paste the serverreq.csr content-->WebserverTemplate. Download the cert.
3. Back to linux, my conf file (/etc/apache2/sites-avaliable/mysite.conf): look like this.
<VirtualHost _default_:443>
Protocols h2 http/1.1
ServerName mysite.local
ServerAlias www.mysite.local
DocumentRoot /var/www/html/mysite
SSLEngine on
SSLCertificateFile /etc/ssl/certandkey/myservercert.crt
SSLCertificateKeyFile /etc/ssl/certandkey/myserverkey.key
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
<VirtualHost *:80>
ServerName mysite.local
Redirect / https://mysite.local/
</VirtualHost>
Do I need to configure the # Server Certificate Chain: and # Certificate Authority (CA):?
4. After this, If I open the webpage it says
Certificate - missing
This site is missing a valid, trusted certificate (net::ERR_CERT_COMMON_NAME_INVALID).
But if I open the OpenManage it says
Certificate - valid and trusted
The connection to this site is using a valid, trusted server certificate issued by mydomain-DC-CA
Both certs are from the same windows CA server.
5. I tried to config /etc/ssl/openssl.cnf, but I do not really understand how. If I edit something, then nothing works.
What is wrong with my config, how can I config it? Is there any good tutorial? 90% of the time google shows only self-signed cert and browser magic. But I would like to config it with windows CA.
Thanks for help
Sorry for my english.