Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Parsing HTTPS instead of HTTP in Rails

I know how to parse HTTP requrests using Net::HTTP. How do you parse HTTPS requests?

I've tried and it says as a response (one of the lines):

<head><title>400 The plain HTTP request was sent to HTTPS port</title></head>

stox

Edited:

So to show you in a little bit more detail:

For example, here is the HTTP API

https://xxxxx.info/merchant/balance?password=$main_password

How do I use Net:http to run this? Or do I use something else?

Thanks Stox

like image 882
user1372829 Avatar asked Dec 07 '22 06:12

user1372829


1 Answers

would be helpful if you showed us some code?

try setting these attributes

# assuming http is generated like this http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
# might need this as well? 
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
like image 90
house9 Avatar answered Dec 17 '22 14:12

house9