net-http

Ruby Net::HTTP responds with OpenSSL::SSL::SSLError “certificate verify failed” after certificate renewal

こ雲淡風輕ζ 提交于 2019-11-28 01:57:23
We recently renewed the SSL certificate of our site, and the following occurs on Mac OS El Capitan 10.11.3: require 'net/http' Net::HTTP.get URI('https://www.google.com') # => "<HTML>...</HTML>" # The site whose certificate got renewed Net::HTTP.get URI('https://www.example.com') # => OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=error: certificate verify failed All my searches on Google and StackOverflow come up with answers suggesting a problem with the Ruby installation, but they seem to be related to older Ruby versions and I don't think this is the case here. Here is what I

OpenSSL::SSL::SSLError: SSL_connect SYSCALL returned=5 errno=0 state=SSLv3 read server hello A

放肆的年华 提交于 2019-11-27 20:02:57
The code below yields the following error: OpenSSL::SSL::SSLError: SSL_connect SYSCALL returned=5 errno=0 state=SSLv3 read server hello A require 'net/https' uri = URI.parse("https://<server>.com") http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true http.ssl_version = 'SSLv3' http.get(uri.request_uri) Any idea why? I tried everything mentioned in all other questions, still no luck. Ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-darwin13.3.0] OpenSSL 0.9.8y 5 Feb 2013 Update I Tried the following: Ruby 2.0.0p353 (2013-11-22 revision 43784) [x86_64-darwin13.3.0] OpenSSL 1.0.1i 6 Aug

What is the difference between Ruby's 'open-uri' and 'Net:HTTP' gems?

江枫思渺然 提交于 2019-11-27 17:21:46
问题 It seems like both of these gems perform very similar tasks. Can anyone give examples of where one gem would be more useful than the other? I don't have specific code that I'm referring to, I'm more wondering about general use cases for each gem. I know this is a short question, I will fill in the blanks upon request. Thanks. 回答1: The reason they look like they perform similar tasks is OpenURI is a wrapper for Net::HTTP, Net::HTTPS, and Net::FTP. Usually, unless you feel you need a lower

Ruby Net::HTTP responds with OpenSSL::SSL::SSLError “certificate verify failed” after certificate renewal

我怕爱的太早我们不能终老 提交于 2019-11-27 04:50:51
问题 We recently renewed the SSL certificate of our site, and the following occurs on Mac OS El Capitan 10.11.3: require 'net/http' Net::HTTP.get URI('https://www.google.com') # => "<HTML>...</HTML>" # The site whose certificate got renewed Net::HTTP.get URI('https://www.example.com') # => OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=error: certificate verify failed All my searches on Google and StackOverflow come up with answers suggesting a problem with the Ruby installation, but

Ruby - net/http - following redirects

只谈情不闲聊 提交于 2019-11-27 03:34:29
I've got a URL and I'm using HTTP GET to pass a query along to a page. What happens with the most recent flavor (in net/http ) is that the script doesn't go beyond the 302 response. I've tried several different solutions; HTTPClient, net/http, Rest-Client, Patron... I need a way to continue to the final page in order to validate an attribute tag on that pages html. The redirection is due to a mobile user agent hitting a page that redirects to a mobile view, hence the mobile user agent in the header. Here is my code as it is today: require 'uri' require 'net/http' class Check_Get_Page def more

OpenSSL::SSL::SSLError: SSL_connect SYSCALL returned=5 errno=0 state=SSLv3 read server hello A

旧时模样 提交于 2019-11-26 22:52:36
问题 The code below yields the following error: OpenSSL::SSL::SSLError: SSL_connect SYSCALL returned=5 errno=0 state=SSLv3 read server hello A require 'net/https' uri = URI.parse("https://<server>.com") http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true http.ssl_version = 'SSLv3' http.get(uri.request_uri) Any idea why? I tried everything mentioned in all other questions, still no luck. Ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-darwin13.3.0] OpenSSL 0.9.8y 5 Feb 2013 Update I

Process Management for the Go Webserver

不想你离开。 提交于 2019-11-26 21:02:01
I'm a new Go programmer, coming from the world of web application and service development. Apologies is this is a herp de-derp question, but my googling around for an answer hasn't found anything. Also, this is borderline Server Fault territory, but since I'm more interested in the APIs/programmatic interfaces I'm asking here. I've written a small go program using the net/http package's built-in web server. I'm getting ready to deploy to production, but I'm a little unclear on the process of model go Go's web-server and how I should deploy. Specifically -- in the environments I'm used to (PHP,