Update expiring SSL certificate shows old one

Operating system: Ubuntu
OS version: 20.04

Hello, my SSL cert expires 18. Oct 2021 and I added the new certificate in the specified file: /etc/ssl/pharmya/ssl.cert

# grep "certfile" /etc/webmin/miniserv.conf
certfile=/etc/ssl/pharmya/ssl.cert

Then i restarted webmin:

service webmin restsart

I checked in Webmin configuration > SSL Encryption > Current Certificate and it shows the correct expiry date 13 Nov 2022.

However in browser clicking on certificate info it shows the old date. I tried in https://www.sslshopper.com/ssl-checker.htm and it still shows the old date.
Instead of the webmin domain i tested directly with IP:10000 in sslshopper and it showed the new expiry date fine.

Why it caches the ssl certificate and shows the old one?

It doesn’t.

You’re misunderstanding what’s happening.

Webmin is not the same as your domain or your web server. Modifying the Webmin certificate has nothing to do with any of your domains or your web server (Apache or nginx). Webmin has its own web server. Port 10000 is literally a different server from port 443 (the default https port, being served by Apache or nginx).

If you want your web server to use the new cert, you need to configure it to use it (or copy it to where the web server is configured to find it). Virtualmin manages all this for you, though, so I’m not sure why you’d be doing any of this manually (unless you’re not using Virtualmin).

No, you did not understood. I updated the webmin ssl certificate by editing the certfile location seen in miniserv.conf. Then i restarted the webmin service and still old cert was provided in web browser when open webmin on port 10000.
I do not talk about web server ssl, there it works fine after update and restart of apache.

Oh, you have the opposite problem, but still a misunderstanding.

If you have a domain with a certificate managed by Virtualmin, Webmin will use the certicate for that domain when you connect using that name. There will be many certificates configured in miniserv.conf, if you have many domains with certificates being managed by Virtualmin. certfile will only be used if you connect to Webmin on some name other than one that Virtualmin manages. There will be directives named something like ipcert_domain.tld for those domains.