I'm trying to get some data from a remote server with SOAP using PHP 7.0, but I get the following error:
SoapFault Object[message:protected] => SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://url.com'.
It works fine on the browser and when https is disabled.
I've already tried to disable SSL verification with:
'ssl' => [
// set some SSL/TLS specific options
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
]
And to pass my cert and key with:
'ssl' => [
'local_cert' => $sslClientCert,
'local_pk' => $sslClientKey'
]
None of them works. I have also verified that openssl is enabled on the server with phpinfo()
. How do I solve this problem?
<?php
$url = "https://theurl.com";
$client = new SoapClient($url, [
'stream_context' => stream_context_create([
'ssl' => [
"verify_peer"=>false,
"verify_peer_name"=>false,
]
]),
'trace' => 1,
'exceptions' => true
]);
$params = ['groups' => [
[
"courseid" => 3,
"name" => "Group test",
"description" => "Group test",
"descriptionformat" => 1,
"enrolmentkey" => "",
"idnumber" => ""
]
]];
$response = $client->__soapCall('core_group_create_groups',$params);