How this fix OpenSSL error in Rails (OSX)?
To be more specific, this errors:
```
OpenSSL::SSL::SSLError in XxxController#action
SSL_connect returned=1 errno=0 state=error: certificate verify failed
```
![](http://i.imgur.com/CM7d8AT.jpg)
**How to fix?**
If you need install [wget](http://brewformulas.org/Wget) first.
```
$ cd /usr/local/etc/openssl/certs/
$ wget https://curl.haxx.se/ca/cacert.pem
$ nano ~/.zshrc
```
Add this line into the `.zshrc` file:
```
export SSL_CERT_FILE=/usr/local/etc/openssl/certs/cacert.pem
```
And, run this command:
```
$ source ~/.zshrc
```
**Note**
If you don't have `.zshrc` file, use `.bash_profile` file. I'm using [Z Shell](https://en.wikipedia.org/wiki/Z_shell) - that's why I have `.zshrc` file.