1

I have to make a OCSP cert verification call with the cert issued by some system . The OCSP team shared the below curl url as sample

curl --cert <XYZ>.pem.txt --key <XYZprivatekey>.key.pem --cacert ABCASDStaging.cer.txt https://osd.staging.sd.sd.sg --data-binary @request.der --header "Content-Type:application/ocsp-requests" --header "Host:ocsp.staging.xvc.sdf.sg" --output asdasd-ocsp-resp.der --insecure -v >> STG CDNS.txt2>&1

Im trying to code the above curl request in to java rest template request but unable to proceed. Can help to convert this request in to java rest template

Created the header

 HttpHeaders headers = new HttpHeaders();
    headers.add(HttpHeaders.CONTENT_TYPE, "ocsp-requests");
    headers.add("Host", "ocsp.staging.xvc.sdf.sg");
jannis
  • 4,843
  • 1
  • 23
  • 53
dheeraj
  • 195
  • 2
  • 19
  • Please show your work. – rushi Dec 14 '21 at 06:46
  • @rushi - not Sure how to proceed further or the right way to implement – dheeraj Dec 14 '21 at 07:00
  • Using PEM with RestTemplate: https://stackoverflow.com/questions/33497874/resttemplate-with-pem-certificate – jannis Dec 14 '21 at 12:55
  • The converter posted by [sai manoj](https://stackoverflow.com/users/14554871/sai-manoj) in [this answer](https://stackoverflow.com/a/70347946/4494577) should get you started with the rest: https://reqbin.com/curl – jannis Dec 14 '21 at 12:58

1 Answers1

0

This url has how to make ssl request in Java spring boot using Rest Template: Spring Boot SSL Client

Using the below url we can convert curl request to java code directly: https://reqbin.com/curl

Hope this references might be useful

sai manoj
  • 72
  • 3