I'm getting an SSL Certificate error when I try to access a web server using HTTParty. This is the error I got originally.
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
I tried to correct his by updating default options. The code is below.
class Coursera
include HTTParty
base_uri 'https://api.coursera.org/api/catalog.v1/courses'
default_params fields: "smallIcon,shortDescription", q: "search"
format :json
default_options.update(verify: false)
def self.for term
get("", query: { query: term})["elements"]
end
end
However, this resulted in another error, which is confounding me.
syntax error, unexpected tIDENTIFIER, expecting keyword_end default_options.update(verify: false)
Can someone explain why this error is occurring and how I can bypass the SSL in order to obtain the results of the query?