validity check failed: NotAfter: Thu Apr 01 00:59:59 BST 2021
It is clear : the certificate has expired because today we are after the 01 April 2021.
To fix the problem :
- either ask to the certificate publisher/owner to provide a new one with a valid date.
- or run Maven in a way where it will ignore the certificate validity date.
For the latter (with clean package goal for example) you can do :
mvn clean package -Dmaven.wagon.http.ssl.ignore.validity.dates=true
If you want to ignore completely all ssl verifications, you can set all these flags :
mvn clean package -Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.http.ssl.ignore.validity.dates=true
To not repeat the flags at every mvn command executed, you can also set the MAVEN_OPTS
env variable such as :
MAVEN_OPTS="-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.http.ssl.ignore.validity.dates=true"
Edit
To help diagnostic issue :
see the content of a certificate with openssl (Linux or Mac) such as :
openssl x509 -in foo.crt -noout -text
To see only dates (@dave_thompson_085) :
openssl x509 -in foo.crt -noout -dates
On Windows, openssl is not required since the file association of the crt should help.
Make maven to run in debug verbosity (-X flag)
mvn -X clean package
Make maven to run with SSL logs enabled :
mvn -Djavax.net.debug=ssl clean package
You could even use all these flags :
mvn -X \
-Djavax.net.debug=ssl \
-Dmaven.wagon.http.ssl.insecure=true \
-Dmaven.wagon.http.ssl.allowall=true \
-Dmaven.wagon.http.ssl.ignore.validity.dates=true \
clean package