Advertisement
Guest User

Untitled

a guest
Mar 30th, 2020
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.72 KB | None | 0 0
  1. $wsdl = 'PATH/TO/WSDL';
  2. $url = 'http://URL_TO_SOAP_SERVICE';
  3. $cert = 'PATH/TO/CLIENT/CERT';
  4.  
  5. $context = stream_context_create([
  6.     'ssl' => [
  7.         'crypto_method' =>  STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT,
  8.         'verify_peer' => true,
  9.         'verify_peer_name' => true,
  10.         'allow_self_signed' => false,
  11.         'cafile' => '/path/to/cafile.selfsigned'
  12.     ]
  13. ]);
  14.  
  15. $params = [
  16.     'location' => $url,
  17.     'local_cert' => $cert,
  18.     'trace' => true,
  19.     'exceptions' => true,
  20.     'verifypeer' => true,
  21.     'verifyhost' => true,
  22.     'allow_self_signed' => false,
  23.     'connection_timeout' => 180,
  24.     'keep_alive' => false,
  25.     'stream_context' => $context
  26. ];
  27.  
  28. $client = new SoapClient($wsdl, $params)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement