210

Problem w PHP: SoapClient::__doRequest(): SSL operation failed with code 1. OpenSSL Error messages: error:141A318A:SSL routines:tls_process_ske_dhe:dh key too small

php-1.png

Podczas realizacji zapytań w php przez curl lub soap możemy natrafić na taki problem:

 

SoapClient::__doRequest(): SSL operation failed with code 1. OpenSSL Error messages: error:141A318A:SSL routines:tls_process_ske_dhe:dh key too small

 

Rozwiązaniem tego problemu jest:

 

1. Ustawienie w konfiguracji OpenSSL

 

openssl: /etc/ssl/openssl.cnf

Wartości: CipherString = DEFAULT:@SECLEVEL=1

 

2. W php dla CURL:

curl_setopt($ch, CURLOPT_SSL_CIPHER_LIST, 'DEFAULT:@SECLEVEL=1');

 

3. W php w SOAP:

$opts = array(
 'ssl' => array(
   'ciphers' => 'DEFAULT@SECLEVEL=1',
  )
);
$streamContext = stream_context_create($opts);
$params = array(
  'stream_context' => $streamContext,
);
$client = new SoapClient(null, array_merge([
  'location' => $url,
  'uri' => $url,
], $params));

Sokół Łukasz
.
11-04-2022 501 odsłon