I cannot access to server through RestClient.
I have this code written in cURL (it sends XML file to server for parsing)
curl -T /Users/amok/Code/1188/dragon/test.xml --cert Users/amok/Code/1188/dragon/client_1188.pem --key Users/amok/Code/1188/dragon/client_1188.key -k -u 1188:aaa https://smart.com/index.cgi
Need to make the same in RestClient. I've tried this one, but it doesnt work.
return RestClient::Resource.new(
'https://smart.com/index.cgi',
:ssl_client_cert => OpenSSL::X509::Certificate.new(File.read(File.join(Rails.root, "/cert/client_1188.pem"))),
:ssl_client_key => OpenSSL::PKey::RSA.new(File.read(File.join(Rails.root, "/cert/client_1188.key"))),
:user => '1188',
:password => 'aaa'
).post(xml, :content_type => 'application/xml')
(xml is file, stored on server)
The problem is:
OpenSSL::SSL::SSLError in BackOffice::DragonPilotController#create
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
The palm is on my face now... ((( Thank you
use PUT method instead of POST