# What to do when you get "SSL\_connect returned=1 errno=0 state=error: certificate verify failed (self signed certificate in certificate chain)"

**URL:** <https://community.forestadmin.com/t/what-to-do-when-you-get-ssl-connect-returned-1-errno-0-state-error-certificate-verify-failed-self-signed-certificate-in-certificate-chain/2825>\
**Category:** Help me!\
**Created:** [July 1, 2021, 12:49pm UTC](https://community.forestadmin.com/t/what-to-do-when-you-get-ssl-connect-returned-1-errno-0-state-error-certificate-verify-failed-self-signed-certificate-in-certificate-chain/2825 "2021-07-01T12:49:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yoran](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/yoran/32/2566_2.png) [@yoran](https://community.forestadmin.com/u/yoran)\
**Post date:** [July 1, 2021, 12:49pm UTC](https://community.forestadmin.com/t/what-to-do-when-you-get-ssl-connect-returned-1-errno-0-state-error-certificate-verify-failed-self-signed-certificate-in-certificate-chain/2825/1 "2021-07-01T12:49:22Z")

</div>

The authentication request to Forest was failing for us with the error `SSL_connect returned=1 errno=0 state=error: certificate verify failed (self signed certificate in certificate chain)`:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/7/7cf05d958c299eb6a0b871d50f49bc14076fa945.png)

It turns out that the `forest-rails` gem uses the Rails cache during the authentication. We use Redis as our cache store, through the Heroku Redis addon. And Redis 6 sometimes has issues with self-signed certificates. This is documented here: [Redis Connection Issues - Heroku Help](https://help.heroku.com/HC0F8CUS/redis-connection-issues)

We resolved the issue by adding the `verify_mode: OpenSSL::SSL::VERIFY_NONE` parameter when setting up the Rails cache store:

```javascript
config.cache_store = :redis_cache_store, {
    url: ENV.fetch('REDIS_URL'),
    # Necessary for Redis 6 and our SSL certificate (see
    # https://help.heroku.com/HC0F8CUS/redis-connection-issues)
    ssl_params: {
      verify_mode: OpenSSL::SSL::VERIFY_NONE
    }
  }

```

I posted this to help anyone who has this issue and doesn’t know what to do. Maybe this can fix the issue for them too.

---

<div class="post-metadata">

**Author:** ![GuillaumeGautreau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/guillaumegautreau/32/557_2.png) [@GuillaumeGautreau](https://community.forestadmin.com/u/GuillaumeGautreau)\
**Post date:** [July 1, 2021, 12:51pm UTC](https://community.forestadmin.com/t/what-to-do-when-you-get-ssl-connect-returned-1-errno-0-state-error-certificate-verify-failed-self-signed-certificate-in-certificate-chain/2825/2 "2021-07-01T12:51:01Z")

</div>

Hi @yoran, thanks a lot for sharing this tip! ❤
