Hi All, Does anybody know the solution this error?...
# cfml-general
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.
a
Does you scheduled task call a https endpoint?
f
@aliaspooryorik, Yes, It does.
https://
a
OK, so that domain you are calling has an SSL certificate so you need to install that for Java to trust it
f
@aliaspooryorik I appreciate that. Are you asking me to use this:
SSLCertificateInstall( host=string_, port=number_ );
?
a
yes
f
Do i need to add this code on the top of the file which i am calling from lucee server?
sslCertificateInstall( domain );
a
no - you don't change the file you are calling. You need the Lucee server to trust the domain it is calling.
f
Copy code
Where should i add this code? sslCertificateInstall( domain );
a
I don't know your code base. You should run it on the Lucee server - should only need to run it once.
Alternatively you can manually install the cert into your Java cacerts keystore
f
Currently i have these certs,
a
That means nothing to me 🙂 Is that supposed to be the certificate for the domain you are calling?
f
Yes these certs are attached to my domain.
r
I run into this issue constantly. As @aliaspooryorik article suggests. Shot gunning the keys into cacerts is not the best approach but I like guns so this is what I inevitably do. If you would like to do it this way you need to download the cert using a browser such as firefox then use
keytool.exe
found in
{cfroot}/jvm/bin
and run the following command
Copy code
keytool.exe -importcert -file certificate.cer -keystore "pathto/cacerts" -alias "Alias"
f
@Ryan Albrecht
keytool.exe
is not getting open in
{cfroot}/jvm/bin
r
@FAHEEM MALIK on windows this is normally the path
C:\ColdFusion2021\jre\bin\keytool.exe
and the cacerts file is
C:\ColdFusion2021\jre\lib\security\cacerts
f
I'm using lucee. I saw the keytool.exe file there, and try to open it using double click and it is not opening
r
oohhhh
f
Then i saw somewhere to open it with bash
r
keytool.exe is a commandline application so you have to use with the terminal
but it should still work the same way.
with lucee
f
I locate the keytool.exe file but do not know how to run the command given by you
r
Ok easiest way would be to open a terminal and
cd
into the same directory as keytool
then just to check you in the right place execute
.\keytool.exe -help
let me know what output you get. Eg. should look something like this
image.png
f
I was not pre-pending .\ ..
I'll try in 20 mints and get back to you then.
Thank you
r
ok. I will in and out most of the day. Just shoot me a question but it may take me a bit of time to reply sometimes
f
No problem. I'll wait for you. Thank you