How to write this code by ruby on rails?
curl -k --cert path/cert.cer --key path/private.key -F "file=path/pkcs7.file" https://server.com/test > resp.txt
UPDATE: I'am used gem curb, my solution:
http = Curl.post("https://server.com/test", signed_data) do|http|
http.cert = "path/included_key.pem" # in linux: cat path/cert.cer path/private.key > path/included_key.pem, more info http://stackoverflow.com/questions/991758/how-to-get-an-openssl-pem-file-from-key-and-crt-files
http.certpassword = '198512' # is optional
http.headers["Content-Type"] = 'application/pkcs7-mime' # is optional, needs for me
http.ssl_verify_peer = false # is equal -k flag in curl
end
Rails.logger.info http.body_str