Title: SSL Error When Setting Up Gmail
Last modified: July 22, 2021

---

# SSL Error When Setting Up Gmail

 *  Resolved [jcpwp](https://wordpress.org/support/users/jcpwp/)
 * (@jcpwp)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/openssl-error-when-setting-up-gmail/)
 * I’ve spent all day trying to get the GMail connection working. I kept getting
   authorization failures when going through the wizard, but when I went back into
   Settings I clicked the “Allow plugin to send emails using your Goggle account”
   button. I went through the steps to make that connection, and it gave me the 
   message that “You have successfully linked the current site with your Google 
   API project. Now you can start sending emails through Gmail.
 * However, right below that it also shows an error:
 *     ```
       Mailer: Gmail
       Error creating resource: [message] fopen(): SSL operation failed with code 1. OpenSSL Error messages:
       error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
       [file] C:\inetpub\site\wp-content\plugins\wp-mail-smtp\vendor_prefixed\guzzlehttp\guzzle\src\Handler\StreamHandler.php
       [line] 227
       [message] fopen(): Failed to enable crypto
       [file] C:\inetpub\site\wp-content\plugins\wp-mail-smtp\vendor_prefixed\guzzlehttp\guzzle\src\Handler\StreamHandler.php
       [line] 227
       [message] fopen(https://oauth2.googleapis.com/token): failed to open stream: operation failed
       [file] C:\inetpub\site\wp-content\plugins\wp-mail-smtp\vendor_prefixed\guzzlehttp\guzzle\src\Handler\StreamHandler.php
       [line] 227
       ```
   
 * I am not sure what any of that means. Our site is running under a wilcard cert(*.
   site.com), so I’m hoping it’s not looking for an explicit site name. OpenSSL 
   is enabled in our PHP configuration. We are on PHP 7.3.29, WP 5.5.5, WP Mail 
   SMTP 2.9.0.
    -  This topic was modified 4 years, 10 months ago by [jcpwp](https://wordpress.org/support/users/jcpwp/).
      Reason: Correction to title

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Thread Starter [jcpwp](https://wordpress.org/support/users/jcpwp/)
 * (@jcpwp)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/openssl-error-when-setting-up-gmail/#post-14691267)
 * Should also note this is a Windows Server, 2012 R2 with IIS 8.5.
 *  Thread Starter [jcpwp](https://wordpress.org/support/users/jcpwp/)
 * (@jcpwp)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/openssl-error-when-setting-up-gmail/#post-14694039)
 * I added a line in the SteamHandler.php page to output the args passed into the
   fopen call on line 227 to see what it’s working with. The $uri is “[https://oauth2.googleapis.com/token&#8221](https://oauth2.googleapis.com/token&#8221);
   and the $context is a stream-context resource.
 * Now I’m thinking there is some issue with our security. If I’m understanding 
   the script, it’s trying to pull in the Google API token but it’s failing. I am
   not sure if it’s not connecting, or there is some issue in making the connection,
   or it can’t download the content, or what.
 *  [Sanjeev Aryal](https://wordpress.org/support/users/sanzeeb3/)
 * (@sanzeeb3)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/openssl-error-when-setting-up-gmail/#post-14700876)
 * Hi [@jcpwp](https://wordpress.org/support/users/jcpwp/),
 * Thanks for reaching out. The error message usually indicates the invalid or outdated
   CA certificate your server presented which is used to verify for the secure transport
   of email. Please check and update your certificates.
 * Editing the plugin or WordPress core files is not recommend. If you’d want to,
   you can try [disabling SSL verification](https://gist.github.com/slaFFik/c1d7d4249f47da7195fb973109952090),
   but it’s compromising the security. Here’s how to easily [add custom codes](https://www.wpbeginner.com/plugins/how-to-easily-add-custom-code-in-wordpress-without-breaking-your-site/)
   in your site.
 * I hope this helps!
 *  [Justin Kwapich](https://wordpress.org/support/users/justinkwapich/)
 * (@justinkwapich)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/openssl-error-when-setting-up-gmail/#post-14734469)
 * Hi [@jcpwp](https://wordpress.org/support/users/jcpwp/),
 * We haven’t heard from you in a little more than a week, so I’m going to go ahead
   and mark this ticket resolved. If you still have questions, though, please feel
   welcome to continue the conversation.
 * Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘SSL Error When Setting Up Gmail’ is closed to new replies.

 * ![](https://ps.w.org/wp-mail-smtp/assets/icon-256x256.png?rev=1755440)
 * [WP Mail SMTP by WPForms - The Most Popular SMTP and Email Log Plugin](https://wordpress.org/plugins/wp-mail-smtp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-mail-smtp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-mail-smtp/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-mail-smtp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-mail-smtp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-mail-smtp/reviews/)

## Tags

 * [mail](https://wordpress.org/support/topic-tag/mail/)
 * [OpenSSL](https://wordpress.org/support/topic-tag/openssl/)
 * [SSL](https://wordpress.org/support/topic-tag/ssl/)

 * 4 replies
 * 3 participants
 * Last reply from: [Justin Kwapich](https://wordpress.org/support/users/justinkwapich/)
 * Last activity: [4 years, 10 months ago](https://wordpress.org/support/topic/openssl-error-when-setting-up-gmail/#post-14734469)
 * Status: resolved