# Bug in OpenURI#redirectable?

**URL:** <https://www.ruby-forum.com/t/bug-in-openuri-redirectable/86905>\
**Category:** Ruby\
**Created:** [February 26, 2007, 8:20pm UTC](https://www.ruby-forum.com/t/bug-in-openuri-redirectable/86905 "2007-02-26T20:20:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chris\_McMahon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/74df32/32.png) [@Chris\_McMahon](https://www.ruby-forum.com/u/Chris_McMahon)\
**Post date:** [February 26, 2007, 8:20pm UTC](https://www.ruby-forum.com/t/bug-in-openuri-redirectable/86905/1 "2007-02-26T20:20:49Z")

</div>

Use open-uri to go to [http://www.gmail.com](http://www.gmail.com)

Receive error message

“redirection forbidden: [http://mail.google.com/mail/](http://mail.google.com/mail/) →   
[https://www.google.com/accounts/Ser](https://www.google.com/accounts/Ser)…”

Comment out this from open-uri:

```
  #unless OpenURI.redirectable?(uri, redirect)
  # raise "redirection forbidden: #{uri} -> #{redirect}"
  # end

```

Try again and receive this error:

certificate verify failed (OpenSSL::SSL::SSLError)

In this case, looking at the packets, open-uri seems to be mangling  
something on the redirect, because the cookie being set is expired. I  
haven’t pursued any more diagnosis on the error, but if anyone could  
suggest a way to make this work correctly, I would be happy to hear  
it.

Thanks.
