Showing posts with label curl. Show all posts
Showing posts with label curl. Show all posts

Wednesday, December 5, 2018

curl: (60) Peer's Certificate issuer is not recognized

After our company implements stricter rules, I can't install docker in my vagrant properly. I have been solving this issue for about a week and its hard to point out the correct solution until I found from stackoverflow.



add this in vagrant file
config.vm.box_download_ca_cert = "./Fortinet_CA_SSL.cer"


Finally fixed it. Post the answer here as reference.
  • Export company trusted root certificate with .cer extension. Somthing naming external root certificate
  • Convert the ca file to .pem file using openssl x509 -in xxx.cer -inform der -outform pem -out xxx.pem
Then on the centos 7 os:
  • Install the ca-certificates package: yum install ca-certificates
  • Enable the dynamic CA configuration feature: update-ca-trust force-enable
  • Add the exported pem files to /etc/pki/ca-trust/source/anchors/
  • Use command: update-ca-trust extract



https://stackoverflow.com/questions/47676980/curl-60-peers-certificate-issuer-is-not-recognized

Sunday, November 4, 2018

curl example

In my freelance job, I have tasked which I need to call the API using curl. I don't have any much knowledge of it but I think I got some idea.

Basically, the API is called by a PDA mobile device where a user can enter the information and will send through JSON format and call the API.

But the API call will not always return success. The first task which I want to do is to store that raw json into the server, which I already finish implemented.

The second one is to call the API through curl and passing the failed raw JSON. So before will run the curl, a user who only has SSH access to a server can able to edit the raw JSON and run curl to call API with edited raw JSON.

here's the curl syntax:

curl -vX POST http://206.189.159.4:8080/chicken/api/order/create -d @json/20181008-180947_PDA_1.json --header "Content-Type: application/json"


let me explain more:
-v = verbose
X = request
-d = data json file (i don't know why there is @ at the beginning)
--header "Content-Type: application/json" = i think its understandable as we pass json file here



Eureka!

free online comma separating tool

https://delim.co/#