SSL3_GET_SERVER_CERTIFICATE certificate verify failed on Windows 10 Pro with IIS

前端 未结 1 1687
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-22 01:59

When trying to send emails through smtp.google.com via PHPMailer on PHP hosted by IIS on Windows 10, I get this error message:

Connection failed         


        
相关标签:
1条回答
  • 2020-12-22 02:36

    To paraphrase the guide, download the CA bundle from curl and store it somewhere on your file system. Take the path you saved it to and add a line to your php.ini file saying:

    openssl.cafile = $path
    

    Where $path is where you saved the CA certs to. Then restart your web server to pick up the ini change.

    If that worked, you should see that setting in the output from phpinfo(), and it should also give PHP what it needs to validate the certificate when PHPMailer uses it. Be aware that if the server is presenting a truly invalid or expired certificate, this won’t help, but given that this a well-known problem and solution, I expect it to work.

    0 讨论(0)
提交回复
热议问题