I recently generated a new ssl cert for my local m...
# cfml-general
e
I recently generated a new ssl cert for my local machine, installed the ssl cert in lucee admin, but when making cfhttp calls to the url, it throws the PKIX error, in commandbox v6 is there a way to just have it ignore ssl issues?
b
Is the cert trusted by the machine making the CFHTTP call? Also, what versions of Lucee?
e
Lucee 6.0.3.1 pretty sure i installed it correctly into the keystore as well, but maybe there is more than one keystore
b
Lucee 6 uses the java keystore by default now
I'm not sure if Lucee still has its own cacerts file, but if it does and that's where you installed it, then it's basically being ignored
e
would it be the java that commandbox downloads?
b
It would be whatever Lucee is using
So if you're having CommandBox download a version of Java for Lucee to use, then yes.
Run
Copy code
server info property=javaHome
in the web root to confirm what java is being used by the server
e
gotcha .CommandBox\serverJREs\openjdk11_jre_x64_windows_hotspot_jdk-11.0.24+8\bin\java.exe
i bet i previously installed the cert to the wrong keystore then
b
Yeah, the page in the LUcee admin is basically useless now in Lucee 6 with its default settings
I'm surprised they left it there TBH
Same with the
sslcertificateinstall()
BIF
e
thought i saw a forum post at one time where it was suppose to be hierarchy use the lucee keystore first, then default to machine
b
no
sadly
That was suggested by a community member
he even put in a big ticket and asked for guidance on a pull request
He was basically ignored by team Lucee and gave up
And no such functionality was implemented
It would have been nice for sure
e
oh, maybe thats why i'm remembering it
There were a lot of benefits from Lucee having a trust store-- namely easily installing custom certs. The issue was it got out of date often.
Instead of setting up the hierarchy, they just opted to get rid of it completely, which I don't think was the best move because now we're back to mucking around in a cacerts file buried in your Java installation which can change without notice when Java updates and cannot be easily automated from CFML
That ticket shows how you can get the old behavior back
e
interesting
so instead of trying to muck with the keytool, maybe i'll try to enable the environment variable box env set lucee.use.lucee.SSL.TrustStore=true
b
I would put that in the server.json so it's set every time
👍 1
but yes
Copy code
server set env.lucee.use.lucee.ssl.TrustStore=true
that truly is a terrible setting name, lol
I don't think trying to form a complete English sentence was ideal there
e
Ha, i was just looking at this page instead, needs a reference to the other page someplace 😉 https://commandbox.ortusbooks.com/usage/environment-variables
b
Well, those pages both involve "env vars" but they are different things
The
env set
command is for setting an env var into the current shell context
The
env
key in your
server.json
is for declaring env vars to be passed to a new server process
And while the current shell context's env vars also get passed to a server, it's a little different application
You could certainly set the env vars via a
.env
file, or a Docker/etc orchestrator
And you can do them ad hoc
Copy code
env set foo=bar
server start
but in that ad-hoc example, the env vars wouldn't persist in the shell after you closed it
You can have a global env file for env vars you always want in the shell, but this is really a sort of server-specific config so it makes sense to bundle it int he server.json
e
hmm, these seems correct in the server.json but the lucee admin still has this at the top As Lucee is currently using the JVM TrustStore/cacerts file, this functionality isn't available.
b
typo
I think you copied what I typed above before I fixed it
I was missing a dot between
lucee.ssl
Don't trust anything I type from memory into Slack 🙂
Also, for what it's worth you can change the lucee_extensionsn to be nested as well
nested keys are just concatenated with underscores
So
Copy code
{
  "env": {
    "foo": {
      "bar": "baz"
    }
  }
}
is the same as
Copy code
{
  "env" : {
    "foo_bar" : "baz"
    }
  }
}
It's just nicer to nest IMO if you are going to have a bunch of env vars all with the same prefix
And, as a general rule, Lucee will check for both
Copy code
foo.bar
and
Copy code
foo_bar
conventions
e
gotcha, i think i probably copied and pasted the format a long time ago
e
Thank you so very much @bdw429s for helping me out, my localhost ssl woes are over
👍 1