Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Возможна ли работа с OpenSSL 3.x? #43

Closed
HighwayStar opened this issue Apr 6, 2024 · 5 comments
Closed

Возможна ли работа с OpenSSL 3.x? #43

HighwayStar opened this issue Apr 6, 2024 · 5 comments

Comments

@HighwayStar
Copy link

Пробую запустить тестовые скрипты на Debian 12 с php 8.2 или php 7.4 в обоих случаях проблема

  Error in line 218Error code 0PHP Notice:  fwrite(): send of 1 bytes failed with errno=32 Broken pipe in /home/user/devel/payment-wip/vendor/k-shym/urfa-client/src/Connection.php on line 254
  PHP Notice:  fwrite(): send of 1 bytes failed with errno=32 Broken pipe in /home/user/devel/payment-wip/vendor/k-shym/urfa-client/src/Connection.php on line 255
  PHP Notice:  fwrite(): send of 2 bytes failed with errno=32 Broken pipe in /home/user/devel/payment-wip/vendor/k-shym/urfa-client/src/Connection.php on line 256
  PHP Notice:  fwrite(): send of 2 bytes failed with errno=32 Broken pipe in /home/user/devel/payment-wip/vendor/k-shym/urfa-client/src/Connection.php on line 259
  PHP Notice:  fwrite(): send of 2 bytes failed with errno=32 Broken pipe in /home/user/devel/payment-wip/vendor/k-shym/urfa-client/src/Connection.php on line 260
  PHP Notice:  fwrite(): send of 4 bytes failed with errno=32 Broken pipe in /home/user/devel/payment-wip/vendor/k-shym/urfa-client/src/Connection.php on line 261
@k-shym
Copy link
Owner

k-shym commented Apr 6, 2024

привет, зависит от версии биллинга и выбранного протокола. Напишите версию ядра UTM5 и параметры вызова метода init(...)

@HighwayStar
Copy link
Author

utm 5.3-006

<?php

require __DIR__ . '/vendor/autoload.php';

use URFAClient\URFAClient;

try {

$api = URFAClient::init(array(
    'login'    => 'testuser',
    'password' => 'password',
    'address'  => '10.0.0.1',
    'protocol' => 'tls',
    'api'      => 'api_53-006.xml',
));

$userinfo = $api->rpcf_get_userinfo(array( 'user_id' => 100) );

} catch (Exception $exception){
        echo "Error in line " . $exception->getLine() . "\n";
        echo $exception->getMessage()."\n";

}

?>

так же пробовал 'protocol' => 'auto', с ним на init такая ошибка

PHP Warning:  stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:0A00018A:SSL routines::dh key too small in /home/user/devel/payment-wip/vendor/k-shym/urfa-client/src/Connection.php on line 138
Error in line 224
Error code 22. Version: 3

@HighwayStar
Copy link
Author

Просто исходя их #28 (comment) вообще новее openSSL 1.1.0 проблема? Или с более новой версией биллинга работает и более новые версии openSSL?

@HighwayStar
Copy link
Author

Сама проблема видимо к php и urfa отношения не имеет

openssl s_client -connect 10.254.254.1:11758 -cert vendor/k-shym/urfa-client/admin.crt 
Enter pass phrase for vendor/k-shym/urfa-client/admin.crt:
error setting certificate
4007F7BB077F0000:error:0A00018E:SSL routines:SSL_CTX_use_certificate:ca md too weak:../ssl/ssl_rsa.c:221:

@k-shym
Copy link
Owner

k-shym commented Apr 10, 2024

Ваша конфигурация правильная для указанной версии биллинга, вам нужен PHP собранный с OpenSSL 1.0 или ниже, так как на этих версиях собрано ядро биллинга, в OpenSSL 1.1 выпилили устаревшие методы шифрования, которые используются. Могу порекомендовать поставить CentOS 7 версии, этот дистрибутив ещё поддерживается, и все новые версии PHP собираются с OpenSSL 1.0

@k-shym k-shym closed this as completed Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants