This error has always occurred when I recently used Ruby libraries..
When using the net/IMAP library or the net/HTTP Library (mainly using HTTPS and HTTPS using SSL), the details are as follows:
Error message: e:/ruby200/lib/Ruby/2.0.0/NET/IMAP. RB: 1454: In 'connect': ssl_connect returned = 1 errno = 0 state = SSLv3 read server certificate B: Certificate verify failed (OpenSSL: SSL: sslerror)
The prompt shows that the certificate verification has failed. Why?
SSL connection is a Secure Sockets Layer connection. It encrypts data at the transmission layer to protect the data transmitted in network communication. The SSL certificate is required to use this certificate. In Ruby, the certificate is not verified by default. In the source code of the net/HTTP library
There is an instance variable @ use_ssl = false. The default SSL usage is false, that is, it is not used. (I don't know much about this. You can ignore it)
Specifically, the steps are as follows:
1. Download the certificate. Some certificates seem too early to work. I used this token.
2. then place the certificate in the appropriate place. It is generally in the root directory of the Ruby or rails installation place, for example, my: e: \ ruby200 \ cacert. pem
3. Set the environment variable. In command line (CMD), enter SET ssl_cert_file = E: \ ruby200 \ cacert. Pem, which is only a temporary environment variable. If it is a fixed environment variable, go to the next step.
4. Set fixed environment variables. Under win7, choose Control Panel> system and maintenance> system> advanced system settings (or change Settings> advanced), go to environment variables, select system variables, and create a new one. Enter the following
In this way, you can.
For more information, see https://gist.github.com/fnichol/867550.
In 'connect': ssl_connect returned = 1 errno = 0 state = SSLv3 read server certificate B: Certificate verify failed (OpenSSL: SSL: sslerror)