I have a curl like as shown below
curl -s -g https://example.com:8086 --tlsv1 --cacert /etc/myfolder/certificate.pem --cert /etc/myfolder/ssl/certificate.pem --key /etc/myfolder/com/certificate.pem
I have used apache java http client for accessing the above curl
String url = "https://example.com:8086";
HttpClient client = HttpClientBuilder.create().build();
HttpGet httpGet = new HttpGet(url);
httpGet.setHeader("Content-Type", "application/json");
HttpResponse httpresponse = client.execute(httpGet);
EntityUtils.toString(httpresponse.getEntity());
but I don't know how to pass certiifcates and attributes such as -s
-g
--tlsv1
--cacert /etc/myfolder/certificate.pem
--cert /etc/myfolder/ssl/certificate.pem
--key /etc/myfolder/com/certificate.pem
Can anyone please help me on this
Please note depending on the format of your PEM files you will likely have to load them into a Java keystore first.