When you're using curl, you are using the -k flag
-k, --insecure
(TLS) By default, every SSL connection curl makes is verified to be secure. This option allows curl to proceed and operate even for server connections otherwise considered insecure.
Looks like they've changed the interface a bunch between minor verisons of http client for some reason, but here's a Stack Overflow post that shows a bunch of the methods ignoring certificates
https://stackoverflow.com/questions/2703161/how-to-ignore-ssl-certificate-errors-in-apache-httpclient-4-0
What you probably should do, though, is to add your certificate to your trust store.
https://medium.com/@codebyamir/the-java-developers-guide-to-ssl-certificates-b78142b3a0fc
... View more