# lsb_release -a LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch Distributor ID: CentOS Description: CentOS release 6.4 (Final) Release: 6.4 Codename: Final # yum list installed | grep php php.x86_64 5.3.3-22.el6 @base php-cli.x86_64 5.3.3-22.el6 @base php-common.x86_64 5.3.3-22.el6 @base php-dba.x86_64 5.3.3-22.el6 @base php-devel.x86_64 5.3.3-22.el6 @base php-imap.x86_64 5.3.3-22.el6 @base php-ldap.x86_64 5.3.3-22.el6 @base php-lessphp.noarch 0.3.9-1.el6 @epel php-mbstring.x86_64 5.3.3-22.el6 @base php-mcrypt.x86_64 5.3.3-1.el6 @epel php-odbc.x86_64 5.3.3-22.el6 @base php-pdo.x86_64 5.3.3-22.el6 @base php-pear.noarch 1:1.9.4-4.el6 @base php-pgsql.x86_64 5.3.3-22.el6 @base php-process.x86_64 5.3.3-22.el6 @base php-shout.x86_64 0.9.2-6.el6 @epel php-soap.x86_64 5.3.3-22.el6 @base php-xml.x86_64 5.3.3-22.el6 @base php-xmlrpc.x86_64 5.3.3-22.el6 @base # yum list installed | grep openssl openssl.x86_64 1.0.0-27.el6_4.2 @updates openssl-devel.x86_64 1.0.0-27.el6_4.2 @updates
# rpm -ivh --nosignature http://rpm.axivo.com/redhat/axivo-release-6-1.noarch.rpm # yum --enablerepo=axivo update openssl
# openssl version OpenSSL 1.0.1e 11 Feb 2013
/etc/pki/tls/openssl.cnf
, adding the line to the very beginning of the file: openssl_conf = openssl_def
[openssl_def] engines=engine_section [engine_section] gost=gost_section [gost_section] engine_id=gost #!! dynamic_path=/usr/lib64/openssl/engines/libgost.so default_algorithms=ALL CRYPT_PARAMS=id-Gost28147-89-CryptoPro-A-ParamSet
#openssl ciphers | tr ":" "\n" | grep GOST GOST2001-GOST89-GOST89 GOST94-GOST89-GOST89
# openssl pkcs12 -in mycert.p12 -nodes
# openssl pkcs12 -in mycert.p12 -out mycert.pem -nodes -clcerts
# openssl x509 -inform DER -in cacert.cer -outform PEM -out cacert.pem
# openssl s_client -connect service.rosminzdrav.ru:443 -CAfile cacert.pem -cert mycert.pem
New, TLSv1/SSLv3, Cipher is GOST2001-GOST89-GOST89 Server public key is 256 bit Secure Renegotiation IS NOT supported Compression: NONE Expansion: NONE SSL-Session: Protocol : TLSv1 Cipher : GOST2001-GOST89-GOST89 Session-ID: *** Session-ID-ctx: Master-Key: *** Key-Arg : None Krb5 Principal: None PSK identity: None PSK identity hint: None SRP username: None Start Time: 1375875984 Timeout : 300 (sec) Verify return code: 0 (ok)
# yum install rpm-build redhat-rpm-config # mkdir /root/rpmbuild # cd /root/rpmbuild # mkdir BUILD RPMS SOURCES SPECS SRPMS # mkdir RPMS/{i386,i486,i586,i686,noarch,athlon}
# wget http://vault.centos.org/6.4/os/Source/SPackages/php-5.3.3-22.el6.src.rpm # rpm -ivh php-5.3.3-22.el6.src.rpm
# cd SOURCES # tar xvjf php-5.3.3.tar.bz2 # cp php-5.3.3 php-5.3.3p -R
php-5.3.3p/ext/openssl/openssl.c
:SSL_library_init();
(I have this line number 985) and prescribe itOPENSSL_config(NULL);
. # diff -uNr php-5.3.3/ php-5.3.3p/ > php-5.3.3-gostfix.patch
diff -uNr php-5.3.3/ext/openssl/openssl.c php-5.3.3p/ext/openssl/openssl.c --- php-5.3.3/ext/openssl/openssl.c 2010-06-26 20:03:39.000000000 +0400 +++ php-5.3.3p/ext/openssl/openssl.c 2013-08-07 11:32:41.944581280 +0400 @@ -981,7 +981,7 @@ le_key = zend_register_list_destructors_ex(php_pkey_free, NULL, "OpenSSL key", module_number); le_x509 = zend_register_list_destructors_ex(php_x509_free, NULL, "OpenSSL X.509", module_number); le_csr = zend_register_list_destructors_ex(php_csr_free, NULL, "OpenSSL X.509 CSR", module_number); - + OPENSSL_config(NULL); SSL_library_init(); OpenSSL_add_all_ciphers(); OpenSSL_add_all_digests();
Patch231: php-5.3.3-gostfix.patch
%patch231 -p1
# yum install bzip2-devel db4-devel gmp-devel httpd-devel pam-devel sqlite-devel pcre-devel libedit-devel libtool-ltdl-devel libc-client-devel cyrus-sasl-devel openldap-devel mysql-devel postgresql-devel libxml2-devel net-snmp-devel libxslt-devel libxml2-devel libXpm-devel libpng-devel freetype-devel libtidy-devel aspell-devel recode-devel libicu-devel enchant-devel net-snmp
rpmbuild -ba SPECS/php.spec
# ls RPMS/x86_64/ php-5.3.3-22.el6.x86_64.rpm php-devel-5.3.3-22.el6.x86_64.rpm php-intl-5.3.3-22.el6.x86_64.rpm php-pgsql-5.3.3-22.el6.x86_64.rpm php-tidy-5.3.3-22.el6.x86_64.rpm php-bcmath-5.3.3-22.el6.x86_64.rpm php-embedded-5.3.3-22.el6.x86_64.rpm php-ldap-5.3.3-22.el6.x86_64.rpm php-process-5.3.3-22.el6.x86_64.rpm php-xml-5.3.3-22.el6.x86_64.rpm php-cli-5.3.3-22.el6.x86_64.rpm php-enchant-5.3.3-22.el6.x86_64.rpm php-mbstring-5.3.3-22.el6.x86_64.rpm php-pspell-5.3.3-22.el6.x86_64.rpm p hp-xmlrpc-5.3.3-22.el6.x86_64.rpm php-common-5.3.3-22.el6.x86_64.rpm php-fpm-5.3.3-22.el6.x86_64.rpm php-mysql-5.3.3-22.el6.x86_64.rpm php-recode-5.3.3-22.el6.x86_64.rpm php-zts-5.3.3-22.el6.x86_64.rpm php-dba-5.3.3-22.el6.x86_64.rpm php-gd-5.3.3-22.el6.x86_64.rpm php-odbc-5.3.3-22.el6.x86_64.rpm php-snmp-5.3.3-22.el6.x86_64.rpm php-debuginfo-5.3.3-22.el6.x86_64.rpm php-imap-5.3.3-22.el6.x86_64.rpm php-pdo-5.3.3-22.el6.x86_64.rpm php-soap-5.3.3-22.el6.x86_64.rpm
rpm -Uvh --replacepkgs --replacefiles RPMS/x86_64/*
<?php class GetEmployees { public $ogrn; } $cert="/mycert.pem"; // $wsdl="https://service.rosminzdrav.ru/MedStaffIntegration/MedStaff.svc?wsdl"; // wdsl $loc = "https://service.rosminzdrav.ru/MedStaffIntegration/medstaff.svc/basic"; // $sp = new SoapClient($wsdl,array( 'local_cert' => $cert, 'trace' => 1, 'exceptions' => 1, 'soap_version' => SOAP_1_1, 'location' =>$loc, )); $emp = new GetEmployees; $emp->ogrn = '1022303554570'; try{ $data = $sp->GetEmployees($emp); print_r($data); } catch (SoapFault $e) { echo "<h2>Exception Error!</h2>"; echo $sp->__getLastRequest(); echo get_class($e); echo $e->getMessage(); }
Source: https://habr.com/ru/post/189352/
All Articles