• Inspiración
  • Tutoriales
  • Bootcamp

En1Mes

  • Inspiración
  • Tutoriales
  • Bootcamp

SSL error: Certificate Verify Failed

certificado SSL
Cuando se utilizan las APIs de Facebook o de Twitter en Ruby on Rails en un computador con windows verás el siguiente error.
OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed

Este es un error común cuando se trabaja con APIs que están detrás de un protocolo HTTPs. La solución para arreglar este error en windows consiste en seguir los siguientes pasos.

1. Descargar este archivo: http://curl.haxx.se/ca/cacert.pem

2. En tu proyecto > lib guardas ese archivo con “guardar como..”  y le pones este nombre: ca-bundle.crt

3. Luego abres tu editor de texto favorito, el mío es Sublime y en  tu proyecto >config >initializers

4. Dentro de carpeta “initializers” creas un archivo llamado fix_ssl.rb

5. Pega este código a continuación: (Screenshot)

require 'open-uri'
require 'net/https'
 
module Net
  class HTTP
    alias_method :original_use_ssl=, :use_ssl=
    
    def use_ssl=(flag)
      self.ca_file = Rails.root.join('lib/ca-bundle.crt').to_s
      self.verify_mode = OpenSSL::SSL::VERIFY_PEER
      self.original_use_ssl = flag
    end
  end
end

Luegos reinicias el Server por consola con rails s

 

PD: si revisas el ejemplo con el artículo original certificados de seguridad de Ruby te darás cuenta de un pequeñísimo cambio en la línea 9
original:

1 self.ca_file = Rails.root.join(‘lib/ca-bundle.crt’)
modificación:

self.ca_file = Rails.root.join(‘lib/ca-bundle.crt’).to_s

Este cambio se debe a que Rails 4 necesita este recibir este valor como un string o dará como error

error+no implicit conversion of Pathname into String
Sep 18, 2014Daniela Gattoni
Share Button
  • El Autor
  • Últimos Posts
Daniela Gattoni

About Daniela Gattoni

Software Engineering Student at USM, Santiago, Chile. Web Designer & programmer. #hack4good Santiago 1st place 2014 with #BringYourCup app.
  • Friendly URL en Rails - March 8, 2015
  • Borrar un Scaffold en Ruby on Rails - January 24, 2015
  • “My Concerts Wishlist” ajax scaffold Ruby on Rails - January 1, 2015
  • StreetmusicMap parte 2: Integración Gmaps4Rails - December 12, 2014
  • StreetmusicMap parte 1: Combobox uno a muchos en Ruby on Rails - December 11, 2014
  • Twitter Search API + Ruby on Rails (II parte) - September 24, 2014
  • Twitter Search API + Ruby on Rails - September 24, 2014
  • SSL error: Certificate Verify Failed - September 18, 2014
10 years ago 3 Comments Ruby, Seguridad, TutorialesAPIs, Certificado SSL, Ruby on Rails, SSL, Twitter4,232
Explícale a un idiotaEl diseño web se ha comoditizado
You Might Also Like
 
Nitrous, rails en la nube
 
Taller presencial de Ruby On Rails En Noviembre
Comments: 1
  1. Santiago
    9 years ago

    Hola, he probado con este metodo, pero me sigue diciendo el problema del SSL. Alguna otra idea?

    ReplyCancel
Pingbacks: 2
  1. Twitter Search API + Ruby on Rails | En1mes
    10 years ago
  2. Twitter Search API Ruby on Rails
    10 years ago

Leave a Reply to Santiago Cancel reply

Tags
mostbetslotticamostbet UZslottica PLRuby on Railsaviatoraviator KZozwincasinoozwincasino AUemprendimientos digitalesfortunetiger BRfortunetigerTutorialesDiseñoLondonLondon UZbj88slottica BRHerramientashtml5WordpressrubyLanding Pageparty poker casinogratogana juegos en vivoแทงบอลออนไลน์Bases de datoswash serviceหวยออนไลน์gratogana entrar20bet plkudos casino no deposit bonus 2024kudos casino loginTallereshackathonkudos casino no deposit bonuspartycasino entrarHeroku1win AZ1winTipsPáginas WebNitrousInspiracióncbd
  • PADANGTOTO
  • PADANGTOTO
  • PADANGTOTO
  • PADANGTOTO
  • PADANGTOTO
  • PADANGTOTO
  • PADANGTOTO
  • PADANGTOTO
  • PADANGTOTO
  • PADANGTOTO
  • PADANGTOTO
  • PADANGTOTO
  • PADANGTOTO
  • PADANGTOTO
  • PADANGTOTO
  • PADANGTOTO
  • PADANGTOTO
  • PADANGTOTO
  • PADANGTOTO
  • PADANGTOTO
  • PADANGTOTO
  • PADANGTOTO
  • Interesado en otros tipos de emprendimiento?

    Quieres aprender a importar y exportar productos a todo el mundo? entra aquí

  • LOMBOKTOTO
  • LOMBOKTOTO
  • LOMBOKTOTO
  • LOMBOKTOTO
  • LOMBOKTOTO
  • LOMBOKTOTO
  • LOMBOKTOTO
  • LOMBOKTOTO
  • LOMBOKTOTO
  • LOMBOKTOTO
  • LOMBOKTOTO
  • LOMBOKTOTO
  • LOMBOKTOTO
  • LOMBOKTOTO
  • No te pierdas ningún artículo.

  • RAMALANTOTO
  • RAMALANTOTO
  • RAMALANTOTO
  • RAMALANTOTO
  • RAMALANTOTO
  • RAMALANTOTO
  • RAMALANTOTO
  • RAMALANTOTO
  • RAMALANTOTO
  • RAMALANTOTO
  • RAMALANTOTO
  • RAMALANTOTO
  • RAMALANTOTO
  • RAMALANTOTO
  • 2016 © En 1 Mes