简体   繁体   English

SoapServer::SoapServer():SSL 操作失败,代码为 1

[英]SoapServer::SoapServer(): SSL operation failed with code 1

i have exposed a couple of web services through Yii.我已经通过 Yii 公开了几个 Web 服务。 After upgrading to PHP 5.6.33 from PHP 5.5.x, i face the following error从 PHP 5.5.x 升级到 PHP 5.6.33 后,我遇到以下错误

SoapServer::SoapServer(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

the error occurs on line 166 on framework/web/services/CWebService.php (1.1.19) so far i haven't found any work around, the options property is protected and don't know how to bypass this issue, but still http://php.net/manual/en/soapserver.soapserver.php doesn't seem to support same options as SoapClient错误发生在 framework/web/services/CWebService.php (1.1.19) 上的第 166 行,到目前为止我还没有找到任何解决方法,options 属性受到保护,不知道如何绕过这个问题,但仍然http://php.net/manual/en/soapserver.soapserver.php似乎不支持与 SoapClient 相同的选项

            $options["stream_context"] = stream_context_create([ 
                "ssl" => [ 
                    // set some SSL/TLS specific options 
                    "verify_peer" => false, 
                    "verify_peer_name" => false, 
                    "allow_self_signed" => true 
                ]]); 

We ended up that it was a server configuration issue.我们最终认为这是服务器配置问题。 The production servers didn't faced this issue since the certificate was signed from a known authority however in the private servers, we needed to edit the php.ini file生产服务器没有遇到这个问题,因为证书是从已知机构签署的,但是在私有服务器中,我们需要编辑 php.ini 文件

openssl.cafile = "/etc/path/to/pem/file.pem"

I got the error too on Linux (Ubuntu) with PHP7.2 when I tried to create SoapServer in my development environment.当我尝试在我的开发环境中创建 SoapServer 时,我在使用 PHP7.2 的 Linux (Ubuntu) 上也遇到了错误。 If you do not want to set the PHP openssl.cafile globally, just copy your Root CA into the correct folder and update certificates:如果您不想全局设置 PHP openssl.cafile ,只需将您的根 CA 复制到正确的文件夹并更新证书:

sudo cp my_root_ca.pem /usr/share/ca-certificates/my_root_ca.crt
sudo dpkg-reconfigure ca-certificates
sudo update-ca-certificates

While reconfigure ca-certificates you need to select your own certificate and activate it.在重新配置 ca-certificates 时,您需要选择自己的证书并激活它。 (If you do not need your Root CA anymore in your develop environment just reconfigure certificates again, unselect your CA from the list and finally update certificates.) (如果您在开发环境中不再需要根 CA,只需再次重新配置证书,从列表中取消选择您的 CA,最后更新证书。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM