Expire date remains unchanged after renewal

My domain is:
wokine.dev

I ran this command:
sudo certbot certonly --manual --preferred-challenges=dns --agree-tos -d wokine.dev -d *.wokine.dev

It produced this output:
Your cert will expire on 2019-05-30.

My web server is (include version):
Apache

Hi,
I’m trying to renew my certificate. I ran the exact same command i did to create it in the first place (see higher up). Certbot says it’s a success but the expire date remains unchanged. Also, i noticed the key for the DNS challenge remains unchanged.

How can i solve this and renew my certificate for 3 monthes?
Thanks

Hi @pelomedusa,

Welcome to the community forum! I can see in the logs that your certificate renewal from ~30m ago was successful. Can you reload Apache so the new certificate is loaded into memory? You can verify the updated cert is being loaded by the following command.

$ echo | openssl s_client -connect wokine.dev:443 -servername wokine.dev 2>/dev/null | openssl x509 -noout -startdate -enddate
notBefore=Mar  1 13:44:08 2019 GMT
notAfter=May 30 13:44:08 2019 GMT
1 Like

Thanks for your answer.

I did reload Apache and the output is the following:
notBefore=Mar 1 13:44:08 2019 GMT
notAfter=May 30 13:44:08 2019 GMT

The weird thing is that the output from the renewal i did ~30mn ago was:
- Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/wokine.dev/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/wokine.dev/privkey.pem
Your cert will expire on 2019-05-30. To obtain a new or tweaked
version of this certificate in the future, simply run certbot
again. To non-interactively renew all of your certificates, run
“certbot renew”

Can you post your Apache vhost configuration?

	<VirtualHost _default_:443>
		ServerAdmin webmaster@localhost
		DocumentRoot /var/www/html
		ServerName wokine.dev
		# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
		# error, crit, alert, emerg.
		# It is also possible to configure the loglevel for particular
		# modules, e.g.
		#LogLevel info ssl:warn

		ErrorLog ${APACHE_LOG_DIR}/error.log
		CustomLog ${APACHE_LOG_DIR}/access.log combined

		# For most configuration files from conf-available/, which are
		# enabled or disabled at a global level, it is possible to
		# include a line for only one particular virtual host. For example the
		# following line enables the CGI configuration for this host only
		# after it has been globally disabled with "a2disconf".
		#Include conf-available/serve-cgi-bin.conf

		#   SSL Engine Switch:
		#   Enable/Disable SSL for this virtual host.
		SSLEngine on

		#   A self-signed (snakeoil) certificate can be created by installing
		#   the ssl-cert package. See
		#   /usr/share/doc/apache2/README.Debian.gz for more info.
		#   If both key and certificate are stored in the same file, only the
		#   SSLCertificateFile directive is needed.
		SSLCertificateFile	/etc/letsencrypt/live/wokine.dev/fullchain.pem
		SSLCertificateKeyFile /etc/letsencrypt/live/wokine.dev/privkey.pem

		#   Server Certificate Chain:
		#   Point SSLCertificateChainFile at a file containing the
		#   concatenation of PEM encoded CA certificates which form the
		#   certificate chain for the server certificate. Alternatively
		#   the referenced file can be the same as SSLCertificateFile
		#   when the CA certificates are directly appended to the server
		#   certificate for convinience.
		#SSLCertificateChainFile /etc/apache2/ssl.crt/server-ca.crt

		#   Certificate Authority (CA):
		#   Set the CA certificate verification path where to find CA
		#   certificates for client authentication or alternatively one
		#   huge file containing all of them (file must be PEM encoded)
		#   Note: Inside SSLCACertificatePath you need hash symlinks
		#		 to point to the certificate files. Use the provided
		#		 Makefile to update the hash symlinks after changes.
		#SSLCACertificatePath /etc/ssl/certs/
		#SSLCACertificateFile /etc/apache2/ssl.crt/ca-bundle.crt

		#   Certificate Revocation Lists (CRL):
		#   Set the CA revocation path where to find CA CRLs for client
		#   authentication or alternatively one huge file containing all
		#   of them (file must be PEM encoded)
		#   Note: Inside SSLCARevocationPath you need hash symlinks
		#		 to point to the certificate files. Use the provided
		#		 Makefile to update the hash symlinks after changes.
		#SSLCARevocationPath /etc/apache2/ssl.crl/
		#SSLCARevocationFile /etc/apache2/ssl.crl/ca-bundle.crl

		#   Client Authentication (Type):
		#   Client certificate verification type and depth.  Types are
		#   none, optional, require and optional_no_ca.  Depth is a
		#   number which specifies how deeply to verify the certificate
		#   issuer chain before deciding the certificate is not valid.
		#SSLVerifyClient require
		#SSLVerifyDepth  10

		#   SSL Engine Options:
		#   Set various options for the SSL engine.
		#   o FakeBasicAuth:
		#	 Translate the client X.509 into a Basic Authorisation.  This means that
		#	 the standard Auth/DBMAuth methods can be used for access control.  The
		#	 user name is the `one line' version of the client's X.509 certificate.
		#	 Note that no password is obtained from the user. Every entry in the user
		#	 file needs this password: `xxj31ZMTZzkVA'.
		#   o ExportCertData:
		#	 This exports two additional environment variables: SSL_CLIENT_CERT and
		#	 SSL_SERVER_CERT. These contain the PEM-encoded certificates of the
		#	 server (always existing) and the client (only existing when client
		#	 authentication is used). This can be used to import the certificates
		#	 into CGI scripts.
		#   o StdEnvVars:
		#	 This exports the standard SSL/TLS related `SSL_*' environment variables.
		#	 Per default this exportation is switched off for performance reasons,
		#	 because the extraction step is an expensive operation and is usually
		#	 useless for serving static content. So one usually enables the
		#	 exportation for CGI and SSI requests only.
		#   o OptRenegotiate:
		#	 This enables optimized SSL connection renegotiation handling when SSL
		#	 directives are used in per-directory context.
		#SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
		<FilesMatch "\.(cgi|shtml|phtml|php)$">
				SSLOptions +StdEnvVars
		</FilesMatch>
		<Directory /usr/lib/cgi-bin>
				SSLOptions +StdEnvVars
		</Directory>

		#   SSL Protocol Adjustments:
		#   The safe and default but still SSL/TLS standard compliant shutdown
		#   approach is that mod_ssl sends the close notify alert but doesn't wait for
		#   the close notify alert from client. When you need a different shutdown
		#   approach you can use one of the following variables:
		#   o ssl-unclean-shutdown:
		#	 This forces an unclean shutdown when the connection is closed, i.e. no
		#	 SSL close notify alert is send or allowed to received.  This violates
		#	 the SSL/TLS standard but is needed for some brain-dead browsers. Use
		#	 this when you receive I/O errors because of the standard approach where
		#	 mod_ssl sends the close notify alert.
		#   o ssl-accurate-shutdown:
		#	 This forces an accurate shutdown when the connection is closed, i.e. a
		#	 SSL close notify alert is send and mod_ssl waits for the close notify
		#	 alert of the client. This is 100% SSL/TLS standard compliant, but in
		#	 practice often causes hanging connections with brain-dead browsers. Use
		#	 this only for browsers where you know that their SSL implementation
		#	 works correctly.
		#   Notice: Most problems of broken clients are also related to the HTTP
		#   keep-alive facility, so you usually additionally want to disable
		#   keep-alive for those clients, too. Use variable "nokeepalive" for this.
		#   Similarly, one has to force some clients to use HTTP/1.0 to workaround
		#   their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and
		#   "force-response-1.0" for this.
		# BrowserMatch "MSIE [2-6]" \
		#		nokeepalive ssl-unclean-shutdown \
		#		downgrade-1.0 force-response-1.0

	</VirtualHost>

@pelomedusa

Let’s verify that the start and end dates on the new cert are what we should expect.

sudo openssl x509 -in /etc/letsencrypt/live/wokine.dev/fullchain.pem -noout -startdate -enddate

You can also try an Apache restart instead of the reload.

# Verify the apache config
apachectl -t

# Show apache's view of the vhosts
apachectl -S

# Restart apache
apachectl -k restart
1 Like

Let’s verify that the start and end dates on the new cert are what we should expect.

Output:
notBefore=Mar 1 13:44:08 2019 GMT
notAfter=May 30 13:44:08 2019 GMT

You can also try an Apache restart instead of the reload.

Already did!

I can also tell that the cert.pem, file remains unchanged after running certbot (i have a local copy to verify this). The last modification date is changed tho. Thanks again for your help

@Phil is it normal the file remains unchanged? Thanks

Hi @pelomedusa

that's impossible. A new certificate is new, so it has another content.

Is this

/etc/letsencrypt/live/wokine.dev/fullchain.pem

a symbolic link? Or is it a hardcoded file?

What says

ls -al /etc/letsencrypt/live/
2 Likes

ls -al /etc/letsencrypt/live/wokine.dev/fullchain.pem :
lrwxrwxrwx 1 root root 44 mai 20 16:27 /etc/letsencrypt/live/wokine.dev/fullchain.pem -> ../../archive/wokine.dev-0001/fullchain2.pem

ls -al /etc/letsencrypt/live/ :
drwx------ 7 root root 4096 avril 9 17:15 .
drwxr-xr-x 9 root root 4096 mai 21 11:48 ..
drwxr-xr-x 2 root root 4096 mars 1 14:54 site1.wokine.dev
drwxr-xr-x 2 root root 4096 avril 9 17:15 site2.wokine.dev
drwxr-xr-x 2 root root 4096 mars 14 17:05 site3.wokine.dev
-rw-r--r-- 1 root root 740 mars 1 12:27 README
drwxr-xr-x 2 root root 4096 mai 20 15:48 site4.wokine.dev
drwxr-xr-x 2 root root 4096 mai 21 11:49 wokine.dev

Thank you for your help.

I can affirm the file cert.pem has no difference berfore and after running certbot.
EDIT: Also, the TXT challenge always ask me to put the two same values in our DNS records. Weird.

You have created 4 new certificates ( https://check-your-website.server-daten.de/?q=wokine.dev#ct-logs ):

CertSpotter-Id Issuer not before not after Domain names LE-Duplicate next LE
921954567 CN=Let's Encrypt Authority X3, O=Let's Encrypt, C=US 2019-05-20 13:27:33 2019-08-18 13:27:33 *.wokine.dev, wokine.dev
2 entries duplicate nr. 4
921944151 CN=Let's Encrypt Authority X3, O=Let's Encrypt, C=US 2019-05-20 13:19:32 2019-08-18 13:19:32 *.wokine.dev, wokine.dev
2 entries duplicate nr. 3
921932065 CN=Let's Encrypt Authority X3, O=Let's Encrypt, C=US 2019-05-20 13:09:28 2019-08-18 13:09:28 *.wokine.dev, wokine.dev
2 entries duplicate nr. 2
921904780 CN=Let's Encrypt Authority X3, O=Let's Encrypt, C=US 2019-05-20 12:48:33 2019-08-18 12:48:33 *.bizline.wokine.dev, *.web.bizline.wokine.dev
2 entries duplicate nr. 1
921893773 CN=Let's Encrypt Authority X3, O=Let's Encrypt, C=US 2019-05-20 12:39:13 2019-08-18 12:39:13 *.wokine.dev, wokine.dev
2 entries duplicate nr. 1

But you have always used certonly and a full command, so Certbot has created 4 new subdirectories and didn't change your existing configuration.

Perhaps you should change the symbolic link to another folder.

Or use the symbolic links from site1 / 2 / 3 or 4 in your config file.

1 Like

Ok so if i undersand correctly, the certonly option create a new certificate but does not change the symbolic link so i have two possibilities:

  • Change the symbolic link manually
    OR
  • run the same command without certonly

Is that correct? Thanks

EDIT: just to clarify, sites 1,2,3,4 are sub-subdomains so they use different certificates, i juste censored their real names

1 Like

That's correct. But you have already created 4 new certificates. So you shouldn't create a new.

2 Likes

Agreed. Thank you for your help

3 Likes

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