Using Nginx and Let's Encrypt, I have a domain example.com which is secured by Let's Encrypt.
I have another domain name example.net which is redirected as bellow :
server {
listen 80;
listen 443;
server_name example.net *.example.net;
return 301 https://example.com$request_uri;
}
All the Uri's http://www.example.net
, http://example.net
, www.example.net
, example.net
returns https://example.com
and no problem.
When I type https://www.example.net
or https://example.net
the Warning on browser is :
Firefox does not trust this site because it uses a certificate that is not valid for example.net . The certificate is only valid for the following names: example.com, www.example.com
Error code: SSL_ERROR_BAD_CERT_DOMAIN
I need to know that should I add/get certificate for example.net
in addition to my main domain example.com
?? So I need to, two certificates to resolve this problem or any other solution ?