Reputation: 37
I am migrating my application from php 5 to php 7.2. I have a problem with theSoapclient call knowing that it works correctly with php 5.
After a lot of research I am progressing on my soapClient script with php 7.2, but I have a concern for stability. The script will load the wsdl a few times, like 1 time out of 40 and then indicate a loading problem.
[message:protected] => SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://ip?WSDL' : failed to load external entity "http://ip?WSDL"
I added the stream_context , cache_wsdl options but no stable result! it worked twice with this code bellow
$option = array (
'location' => $optionSc['location'],
'uri' => $optionSc['location'],
'login' => $optionSc['login'],
'password' => $optionSc['password'],
'trace' => 1,
'connection_timeout' => 0,
'exceptions' => 1
);
after that it returns like I described first. anyone can help me with that if he fixed this problem I did a lot of researches but nothing is working fine and I am relly blocked!
Upvotes: 1
Views: 2819
Reputation: 1
Instead of changing the settings on the whole system, I solved it by using:
$options['ssl']['ciphers'] = 'DEFAULT@SECLEVEL=1';
in the stream_context
Upvotes: 0
Reputation: 11
I've experienced a similar behaviour. PHP was reporting errors with parsing remote WSDL. The problem was weak certificate used by the remote server that kept being refused by OpenSSL, even before being processed by PHP.
I have confirmed this by trying to download the WSDL using curl
curl REMOTE_ADDRESS
which reported the following error
error:14082174:SSL routines:SSL3_CHECK_CERT_AND_ALGORITHM:dh key too small.
The diffie-hellman key base was 1024 instead of recommended 2048 which I checked using openssl command (see https://weakdh.org/)
openssl s_client -showcerts -connect admonitoring.mediaresearch.cz:443 </dev/null
Until the certificate problem is fixed and a new one, more secure, issued, I have managed to fix this problem by temporarily lowering Openssl security settings.
In /etc/ssl/openssl.cnf (Debian) comment out the following line
# comment out the following line in /etc/ssl/openssl.cnf
CipherString = DEFAULT@SECLEVEL=2
# or set SECLEVEL to 1
CipherString = DEFAULT@SECLEVEL=1
Upvotes: 1