title: "sslv3 alert handshake failure" on ruby 2
body: <p>I am trying to use a webservice with ruby, but it seems to be an issue with it's SSL configuration and ruby 2:</p>
  
  <pre><code>&gt;&gt; require "open-uri"
  =&gt; true
  &gt;&gt; open("https://w390w.gipuzkoa.net/WAS/HACI/HFAServiciosProveedoresWEB/services/FacturaSSPPWebServiceProxyPort") {|f| p f.content_type }
  OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: sslv3 alert handshake failure
  </code></pre>
  
  <p>I've tried with curl and openssl and it works:</p>
  
  <pre><code>curl https://w390w.gipuzkoa.net/WAS/HACI/HFAServiciosProveedoresWEB/services/FacturaSSPPWebServiceProxyPort
  openssl s_client -connect w390w.gipuzkoa.net:443
  </code></pre>
  
  <p>it also works with ruby 1.9:</p>
  
  <pre><code>irb(main):001:0&gt; require "open-uri"
  =&gt; true
  irb(main):003:0&gt; open("https://w390w.gipuzkoa.net/WAS/HACI/HFAServiciosProveedoresWEB/services/FacturaSSPPWebServiceProxyPort") {|f| p f.content_type }
  "text/html"
  </code></pre>
  
  <p>with ruby 2, I've tried using TLS, without success</p>
  
  <pre><code>&gt;&gt; OpenSSL::SSL::SSLContext::DEFAULT_PARAMS[:ssl_version] = :TLSv1
  =&gt; :TLSv1
  &gt;&gt; open("https://w390w.gipuzkoa.net/WAS/HACI/HFAServiciosProveedoresWEB/services/FacturaSSPPWebServiceProxyPort") {|f| p f.content_type }
  OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=unknown state: sslv3 alert handshake failure
  
  &gt;&gt; OpenSSL::SSL::SSLContext::DEFAULT_PARAMS[:ssl_version] = :TLSv1_2
  =&gt; :TLSv1_2
  &gt;&gt; open("https://w390w.gipuzkoa.net/WAS/HACI/HFAServiciosProveedoresWEB/services/FacturaSSPPWebServiceProxyPort") {|f| p f.content_type }
  OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=unknown state: wrong version number
  </code></pre>
  
  <p>checking server SSL configuration on <a href="https://www.ssllabs.com/ssltest/analyze.html?d=w390w.gipuzkoa.net" rel="nofollow">https://www.ssllabs.com/ssltest/analyze.html?d=w390w.gipuzkoa.net</a> it returns this error: "Assessment failed: Unexpected failure", since I can access several similar webservices with ruby 2, I guess they have something miss-configured.</p>
  
  <p>any ideas how can I access this webservice with ruby 2?</p>