Hi All, Does anybody know the solution this error?...
# lucee
f
Hi All, Does anybody know the solution this error?
_“”ERROR”,“Thread-5516974”,“06/14/2024",“110200”,“schedule task:TURC process_continuous_campaigns_steps_for_today”,“*PKIX path building failed*: sun.security.provider.certpath.SunCertPathBuilderException: *unable to find valid certification path to requested target*;PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target;javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target”_
I am getting this error while running the schedular task from Lucee Server.
c
Try adding the certificate to Lucee for the domain your task calls. You can do it via the admin UI under Services > SSL Certificates. You may need to restart Lucee.
b
That error means the SSL cert of the host being hit is not trusted
Julian's solution should work
f
@cfsimplicity @bdw429s These certs are already installed there.
c
@FAHEEM MALIK Doesn't matter. Add them again.
f
@cfsimplicity Can you please let me know how can i add it again? I have updated them from IIS and restart the Lucee but it doesn’t help
c
Just enter the hostname and click "Install".
✅ 1
As I say you may need to restart Lucee.
f
@cfsimplicity Yes, i did exactly these two things but it doesn’t help.
c
How did you restart Lucee?
f
image.png
c
OK, that should have worked. Are you sure you entered the hostname that your scheduled task is using?
b
I would restart the JVM just in case. I think Java itself may cache the trust store
f
@cfsimplicity Yes, I am sure. These schedular jobs were working since 2 years without any break, This error appears since 4 days now.
b
Lucee basically sets a system property if I recall that Java uses when loading the trust store, and I think it is only loaded once for the JVM
c
I think there must have been some kind of root cert change going on lately as I've noticed a few people with this issue and it hit us the other day too. Our newly renewed Let's Encrypt certs were no longer trusted by Lucee. Re-installing the certs and restarting Lucee fixed the issue for us. Not sure why it isn't in your case.
f
@cfsimplicity @bdw429s I dont know what is happening, but after applying this, issue is still there.
c
I have updated them from IIS and restart the Lucee but it doesn’t help
Wait, does that mean you just updated the certificate in IIS, but not in Lucee's certificate store? It's the Lucee certificate store that needs to be updated.
b
I would confirm exactly what HTTP request is having the issue. is it the request to the actual scheduled task, or does the scheduled task code itself make an explicit http call out to another server
you may be adding the wrong host
f
Hello @bdw429s @cfvonner @cfsimplicity, Thank you for showing the concern on this issue, this was an ultimate help for me. The Java-integrated certificate management utility had a problem that SSL certificate of the host being hit is not trusted. I looked for it on various forums and discovered that I needed to link the certificate for myWebsite with lucee’s keystore. Keystore basically helps us create a single store that can hold multiple certificates. Steps that fixed my problem are: 1. Download the certificate from chrome and place it on the Desktop. 2. open cmd and type
cd C:\lucee\jre\bin
3. The i just ran this command and it worked
keytool.exe -importcert -file "C:\Users\Administrator\Desktop\myWebsiteCertificate.cer" -keystore  "C:\lucee\jre\lib\security\cacerts" -alias "myWebsiteCertificate"
4. Done
b
Ahh, are you on Lucee 6?
Because Julian's solution should have worked for Lucee 5 (which uses its own keystore), but Lucee 6 uses the java keystore
👀 1
but you never actually told us what version you were using, causing us to guess 🙂
f
Ooops, yeah it was my fault that i couldn’t provide the complete info.
@Ryan Albrecht is the guy who provide the solution.
b
Right, I mean we all told you the issue was your keystore did not trust the cert. You just needed to find the correct keystore to add it to
FWIW, I recommend portecle for manually adding certs, keytool, of course, is better if you need to script it
👍 1
Lucee has used it's own trust store since the Railo days which is why we assumed that's where you needed to add it. But this has changed in Lucee 6
Next time, make sure you let us know important things like the Lucee version. I would have told you right away the keystore to use had I known that
f
@bdw429s Thank you for this valuable information. I’ll make sure next time if i stuck into this kind of issue i’ll try to provide the complete information.