基于PHP的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

之前,我创建了一个使用证书发送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>', $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();
代码本身可以工作,但我不明白的是-证书如何在这个客户机-服务器通信中工作

  • 据我所知,安全通信需要两对私钥和证书。每一方一份
  • 有一种方法可以为
    SoapClient
    添加带有一个私钥和证书对的.pem文件
  • 传入消息(两侧)未加密

  • 难道没有办法为
    SoapServer
    传递证书和密钥对吗
  • 如何准确地验证证书(在什么点和检查什么)
  • 如果我能得到他的证书,我如何才能只从我感兴趣的用户那里过滤出消息
  • 对不起,这些幼稚的问题,但你能指出我错在哪里,并提供适当的资源来查找有关这方面的信息吗

    谢谢