How do I make HTTParty ignore SSL?

前端 未结 4 510
醉梦人生
醉梦人生 2020-12-05 17:08

I\'m using a local server to test an application, and make requests to that server from my own machine.

The test server\'s SSL is bad, and HTTParty throws errors bec

4条回答
  •  难免孤独
    2020-12-05 17:35

    This may be totally off base, as I'm new to Ruby, but this is what worked for me when other solutions wouldnt

    OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE
    

    Additional ways of doing this, if you get a 'dynamic constant assignment' (pulled from here)

    OpenSSL::SSL.const_set(:VERIFY_PEER, OpenSSL::SSL::VERIFY_NONE) 
    

提交回复
热议问题