Answer the question
In order to leave comments, you need to log in
How to include new domain in SSL certificate on OpenServer?
Hello! There is a local OpenServer .
I have installed ssl certificates on several domains. Everything is good with them, they have earned.
And now I need to add another domain, and this is where problems already arise.
- If I just add a record about the new domain DNS.2 = new2.test to VC3 and run the generators, then no additional information is entered into the certificate.
- If I delete the certificate I created from the root directory of the certificate, and initially replace the name CN=PhpStorm with CN=PhpAuto in the batch file, then the old CN=PhpStorm certificate is created with a list of domains that does not include the latter.
It seems that somewhere in the registry information about the previous certificate is not cleared and continues to be stored in it. How to include a new domain in a certificate?
Batch and VC3 generators below.
generate.bat
@echo off
set OPENSSL_CONF=%~dp0..\conf\openssl.cnf
..\bin\openssl req -x509 -sha256 -newkey rsa:2048 -nodes -days 5475 -keyout rootCA.key -out rootCA.crt -subj "/CN=OSPanel/"
..\bin\openssl req -newkey rsa:2048 -nodes -days 5475 -keyout server.key -out server.csr -subj "/CN=PhpAuto/"
..\bin\openssl x509 -req -sha256 -days 5475 -in server.csr -extfile v3.txt -CA rootCA.crt -CAkey rootCA.key -CAcreateserial -out server.crt
..\bin\openssl dhparam -out dhparam.pem 2048
@echo off
title Copy to userdata and install certs
set CURRENTDIR=%~dp0
set OSPATH=%CURRENTDIR%..\..\..\..\userdata\config\cert_files
xcopy /y "%CURRENTDIR%dhparam.pem" "%OSPATH%"
xcopy /y "%CURRENTDIR%rootCA.crt" "%OSPATH%"
xcopy /y "%CURRENTDIR%rootCA.key" "%OSPATH%"
xcopy /y "%CURRENTDIR%rootCA.srl" "%OSPATH%"
xcopy /y "%CURRENTDIR%server.crt" "%OSPATH%"
xcopy /y "%CURRENTDIR%server.csr" "%OSPATH%"
xcopy /y "%CURRENTDIR%server.key" "%OSPATH%"
certutil -enterprise -f -v -AddStore "Root" "%OSPATH%\rootCA.crt"
certutil -enterprise -f -v -AddStore "Root" "%OSPATH%\server.crt"
pause
nsComment = "Open Server Panel Generated Certificate"
basicConstraints = CA:false
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid,issuer
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
subjectAltName = @alt_names
[alt_names]
DNS.1 = new1.test
DNS.2 = new2.test
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question