基于PHP的SOAP服务器端证书验证
之前,我创建了一个使用证书发送SOAP消息的系统 示例显示了它是如何完成的:基于PHP的SOAP服务器端证书验证,php,soap,x509,Php,Soap,X509,之前,我创建了一个使用证书发送SOAP消息的系统 示例显示了它是如何完成的: $client_options = array(); $client_options['local_cert'] = '<path to .pem file>'; $client_options['passphrase'] = '<.pem file password>'; $client = new SoapClient('<address to wsdl file>', $cli
$client_options = array();
$client_options['local_cert'] = '<path to .pem file>';
$client_options['passphrase'] = '<.pem file password>';
$client = new SoapClient('<address to wsdl file>', $client_options);
$tmp_res = $client->some_function($params);
$client_options=array();
$client_options['local_cert']='';
$client_options['passphrase']='';
$client=新的SoapClient(“”,$client_选项);
$tmp_res=$client->some_函数($params);
但现在我必须创建一个服务器来接收这样的消息
我找到了许多参考资料,都建议使用以下代码:
$classmap = array('<class_name2>'=>'<class_name2>');
$server = new SoapServer('<path to wdsl file>',array('classmap'=>$classmap));
$server->setClass("<class_name>");
$server->handle();
$classmap=array(“”=>“”);
$server=newsoapserver(“”,数组('classmap'=>$classmap));
$server->setClass(“”);
$server->handle();
代码本身可以工作,但我不明白的是-证书如何在这个客户机-服务器通信中工作
- 据我所知,安全通信需要两对私钥和证书。每一方一份
- 有一种方法可以为
添加带有一个私钥和证书对的.pem文件SoapClient
- 传入消息(两侧)未加密
SoapServer
传递证书和密钥对吗