SSL certificate for subdomain not valid, Alternative name Mismatch

I did the same process for linuxcafe.ga and www.linuxcafe.ga and their SSL certificates are working fine.

My domain is: linuxcafe.ga
subdomains : myportfolio.linuxcafe.ga and www.myportfolio.linuxcafe.ga
I ran this command:
certbot -d myportfolio.linuxcafe.ga -d www.myportfolio.linuxcafe.ga
It produced this output:
Obtaining a new certificate
Created an SSL vhost at /etc/apache2/sites-available/myportfolio.linuxcafe.ga-le-ssl.conf
Deploying Certificate to VirtualHost /etc/apache2/sites-available/myportfolio.linuxcafe.ga-le-ssl.conf
Enabling available site: /etc/apache2/sites-available/myportfolio.linuxcafe.ga-le-ssl.conf
Created an SSL vhost at /etc/apache2/sites-available/myportfolio.linuxcafe.ga-le-ssl.conf
Deploying Certificate to VirtualHost /etc/apache2/sites-available/myportfolio.linuxcafe.ga-le-ssl.conf

Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.


1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you're confident your site works on HTTPS. You can undo this
change by editing your web server's configuration.


Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2
Enhancement redirect was already set.
Enhancement redirect was already set.


Congratulations! You have successfully enabled https://myportfolio.linuxcafe.ga
and https://www.myportfolio.linuxcafe.ga

You should test your configuration at:
https://www.ssllabs.com/ssltest/analyze.html?d=myportfolio.linuxcafe.ga
https://www.ssllabs.com/ssltest/analyze.html?d=www.myportfolio.linuxcafe.ga

My web server is (include version): Apache 2.4.41
The operating system my web server runs on is : Ubuntu 20 LTS
My hosting provider, if applicable, is: DigitalOcean Droplet (VPS)
I can login to a root shell on my machine :Yes
I'm using a control panel to manage my site: NO
The version of my client is : 0.40.0

PLEASE ASSIST!! My aim is to have redirects configured as well.
Feel free to ask any questions

@jxstWieslaw Welcome to the community.

It looks like you have redirects working - at least from http to https. Please give example of what you want. Thanks

curl -I http://myportfolio.linuxcafe.ga
HTTP/1.1 301 Moved Permanently
Date: Sat, 25 Sep 2021 10:38:14 GMT
Server: Apache/2.4.41 (Ubuntu)
Location: https://myportfolio.linuxcafe.ga/
Content-Type: text/html; charset=iso-8859-1

curl -I https://myportfolio.linuxcafe.ga
HTTP/1.1 200 OK
Date: Sat, 25 Sep 2021 10:38:51 GMT
Server: Apache/2.4.41 (Ubuntu)
Last-Modified: Fri, 24 Sep 2021 05:22:10 GMT
ETag: "1164-5ccb6eddf202c"
Accept-Ranges: bytes
Content-Length: 4452
Vary: Accept-Encoding
Content-Type: text/html

curl -I http://www.myportfolio.linuxcafe.ga
HTTP/1.1 301 Moved Permanently
Date: Sat, 25 Sep 2021 10:39:07 GMT
Server: Apache/2.4.41 (Ubuntu)
Location: https://www.myportfolio.linuxcafe.ga/
Content-Type: text/html; charset=iso-8859-1

curl -I https://www.myportfolio.linuxcafe.ga
HTTP/1.1 200 OK
Date: Sat, 25 Sep 2021 10:39:15 GMT
Server: Apache/2.4.41 (Ubuntu)
Last-Modified: Fri, 24 Sep 2021 05:22:10 GMT
ETag: "1164-5ccb6eddf202c"
Accept-Ranges: bytes
Content-Length: 4452
Vary: Accept-Encoding
Content-Type: text/html
1 Like

You may need to clear your browser's cache, the redirects are already working.
OR
Maybe they began to work once you restarted/reloaded Apache.
[a necessary part of that puzzle]

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.