you can disable certificate verification for a given instance of
stock.verify_mode = OpenSSL::SSL::VERIFY_NONE
or you can disable SSL verification globally in your process using:
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE
Note: Ruby interpreter will give you warning that constant is already
initialized. Sometimes you might get hard error. if that's the case you can
unassign constant and initialize it again using following code:
This is not a perfect solution for your problem, but if security is not
a big cocern, you can use above methods to bypass SSL Cert verification.
You will still have encrypted secure connection to server.