{"id":343900,"date":"2023-01-13T15:02:28","date_gmt":"2023-01-13T15:02:28","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=343900"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=343900","title":{"rendered":"<span>OpenSSL + \u0413\u0418\u0421 \u0416\u041a\u0425<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p><a href=\"https:\/\/habr.com\/en\/post\/300856\/\" rel=\"noopener noreferrer nofollow\">\u042d\u0442\u043e \u043e\u0434\u0430 \u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u043f\u043e\u0441\u0442\u0443<\/a>.<\/p>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0430 \u0434\u043b\u044f PHP, \u043d\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u0432\u0441\u0435\u0445.<\/p>\n<h3>\u041a\u043e\u043d\u0444\u0438\u0433\u0438<\/h3>\n<p>\u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u043c \u043e\u0431\u0449\u0430\u0442\u044c\u0441\u044f \u0441 \u0413\u0418\u0421 \u0416\u041a\u0425. \u0422\u0443\u0442 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d \u043a\u043e\u043d\u0444\u0438\u0433 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0441 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0441\u0442\u044c \u043b\u0438\u0448\u043d\u0438\u0435 (\u0434\u043b\u044f \u0432\u0430\u0441) \u043f\u0430\u043a\u0435\u0442\u044b<\/p>\n<p>\u041f\u043e\u043a\u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u0434\u0430<\/p>\n<pre><code>FROM php:8.1-fpm-alpine  # \u044d\u0442\u043e \u043d\u0435 \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u043e, \u043d\u043e \u043c\u043d\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f zsh RUN apk add zsh  # \u043f\u0430\u043a\u0435\u0442\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b openssl RUN apk add \\     git \\     alpine-sdk \\     cmake \\     wget \\     bash \\     libxml2-dev \\     libssl1.1 # \u043f\u0430\u043a\u0435\u0442\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 zip-\u0430\u0440\u0445\u0438\u0432\u0430\u043c\u0438; \u0431\u0443\u0434\u0443\u0442 \u043d\u0443\u0436\u043d\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 xml-\u0444\u0430\u0439\u043b\u0430\u043c\u0438 RUN apk add \\     libzip-dev \\     zip \\     unzip # \u043f\u0430\u043a\u0435\u0442\u044b \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f gd RUN apk add \\     libpng \\     libpng-dev \\     freetype-dev # postgres RUN apk add \\     postgresql-dev  # \u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0441 oracle ADD https:\/\/github.com\/mlocati\/docker-php-extension-installer\/releases\/latest\/download\/install-php-extensions \/usr\/local\/bin\/ RUN chmod +x \/usr\/local\/bin\/install-php-extensions RUN install-php-extensions oci8  # \u043a\u043e\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u0435\u043c php RUN docker-php-ext-configure zip RUN docker-php-ext-configure gd --with-freetype RUN docker-php-ext-install soap pdo pdo_pgsql zip bcmath gd intl  # composer RUN php -r \"copy('https:\/\/getcomposer.org\/installer', 'composer-setup.php');\" RUN php composer-setup.php RUN php -r \"unlink('composer-setup.php');\" RUN mv composer.phar \/usr\/local\/bin\/composer  # \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0434\u0432\u0438\u0436\u043a\u0430 \u0413\u041e\u0421\u0422 \u0434\u043b\u044f openssl WORKDIR \/opt COPY docker\/production\/php\/openssl_gost.conf \/opt\/openssl_gost.conf RUN git clone --branch=openssl_1_1_1 https:\/\/github.com\/gost-engine\/engine.git gost-engine WORKDIR \/opt\/gost-engine RUN mkdir build WORKDIR \/opt\/gost-engine\/build RUN cmake -DCMAKE_BUILD_TYPE=Release -DOPENSSL_ROOT_DIR=\/usr\/ssl -DOPENSSL_LIBRARIES=\/usr\/ssl\/lib -DOPENSSL_ENGINES_DIR=\/usr\/ssl\/lib\/engines-3 .. RUN cmake --build . --config Release RUN cmake --build . --target install --config Release # \u043d\u0430 \u043c\u043e\u0435\u0439 \u043c\u0430\u0448\u0438\u043d\u0435 openssl \u043b\u0435\u0436\u0438\u0442 \u0432 \u043f\u0430\u043f\u043a\u0435 \/etc\/ssl, \u043d\u0430 \u043f\u0440\u043e\u0434\u0435 \u0432 \u043f\u0430\u043f\u043a\u0435 \/etc\/ssl1.1 - \u043d\u0435 \u0441\u0442\u0430\u043b \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u0447\u0435\u043c\u0443 RUN OPENSSL_DIRECTORY=\"$([[ -d \/etc\/ssl1.1 ]] &amp;&amp; echo '\/etc\/ssl1.1' || echo '\/etc\/ssl')\" &amp;&amp; \\     sed -i '1s;^;openssl_conf = openssl_def\\n;' \"$OPENSSL_DIRECTORY\/openssl.cnf\" &amp;&amp; \\     cat \/opt\/openssl_gost.conf >> \"$OPENSSL_DIRECTORY\/openssl.cnf\"  # \u0441\u0442\u0430\u0432\u0438\u043c \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u044b \u0434\u043b\u044f stunnel COPY docker\/production\/php\/stunnel.conf \/etc\/stunnel.conf RUN mkdir -p \/etc\/crypto # \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u0441\u0442\u0435\u043d\u0434\u0430 \u0413\u0418\u0421 \u0416\u041a\u0425 COPY gis\/certs\/ca-ppak.pem \/etc\/crypto\/ca-ppak.pem # \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u0432\u0430\u0448\u0435\u0433\u043e \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430 COPY gis\/certs\/certificate.pem \/etc\/crypto\/certificate.pem # \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u0432\u0430\u0448\u0435\u0433\u043e \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430 COPY gis\/certs\/private.key \/etc\/crypto\/private.key RUN chmod -R 700 \/etc\/crypto  # \u0441\u0442\u0430\u0432\u0438\u043c \u0441\u0430\u043c stunnel WORKDIR \/opt RUN wget https:\/\/www.stunnel.org\/downloads\/stunnel-5.66.tar.gz -O stunnel.tar.gz RUN tar -xvf stunnel.tar.gz WORKDIR \/opt\/stunnel-5.66 RUN sed -i '4745 i SSL_library_init();' src\/options.c RUN .\/configure --disable-libwrap RUN make &amp;&amp; make install  # \u0431\u0443\u0442\u0441\u0442\u0440\u0430\u043f\u0438\u043c cron COPY docker\/production\/php\/crontab \/opt\/crontab RUN chmod 0644 \/opt\/crontab &amp;&amp; crontab \/opt\/crontab RUN crond  WORKDIR \/app  # \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0432\u0441\u0435 \u043d\u0443\u0436\u043d\u044b\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b COPY docker\/production\/php\/startup.sh \/opt\/startup.sh RUN chmod +x \/opt\/startup.sh CMD [\"\/opt\/startup.sh\"] <\/code><\/pre>\n<p>\u041d\u0430 \u0441\u0442\u0440\u043e\u043a\u0435 47 \u0441\u0441\u044b\u043b\u0430\u044e\u0441\u044c \u043d\u0430 openssl_gost.conf, \u0432\u043e\u0442 \u043e\u043d:<\/p>\n<pre><code># gost support [openssl_def] engines = engine_section  [engine_section] gost = gost_section  [gost_section] engine_id = gost dynamic_path = \/usr\/ssl\/lib\/engines-3\/gost.so default_algorithms = ALL CRYPT_PARAMS = id-Gost28147-89-CryptoPro-A-ParamSet<\/code><\/pre>\n<p>\u041d\u0430 \u0441\u0442\u0440\u043e\u043a\u0435 89 \u0441\u0441\u044b\u043b\u0430\u044e\u0441\u044c \u043d\u0430 \/opt\/startup.sh, \u0432\u043e\u0442 \u043e\u043d:<\/p>\n<pre><code>stunnel \/etc\/stunnel.conf php-fpm<\/code><\/pre>\n<p>\u0413\u0434\u0435 stunnel.conf \u044d\u0442\u043e:<\/p>\n<pre><code>socket=lsocket=l:TCP_NODELAY=1 socket=r:TCP_NODELAY=1  CAFile=\/etc\/crypto\/ca-ppak.pem engine=gost sslVersion=TLSv1 engineDefault=ALL  output=\/var\/log\/stunnel.log DEBUG=7  client=yes  [pseudo-https] accept=127.0.0.1:3000 connect=api.dom.gosuslugi.ru:443 ciphers=GOST2012-GOST8912-GOST8912 verify=0 TIMEOUTclose=0 cert=\/etc\/crypto\/certificate.pem key=\/etc\/crypto\/private.keyTCP_NODELAY=1socket=r:TCP_NODELAY=1CAFile=\/etc\/crypto\/ca-ppak.pemengine=gostsslVersion=TLSv1engineDefault=ALLoutput=\/var\/log\/stunnel.logDEBUG=7client=yes[pseudo-https]accept=127.0.0.1:3000connect=api.dom.gosuslugi.ru:443ciphers=GOST2012-GOST8912-GOST8912verify=0TIMEOUTclose=0cert=\/etc\/crypto\/certificate.pemkey=\/etc\/crypto\/private.key<\/code><\/pre>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u044f \u043a \u043a\u043e\u043d\u0444\u0438\u0433\u0430\u043c<\/h3>\n<ul>\n<li>\n<p>\u041f\u0443\u0442\u0438 \u0434\u043e \u0444\u0430\u0439\u043b\u043e\u0432, \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0435 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a\u043e\u0440\u043d\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430:<\/p>\n<ul>\n<li>\n<p>docker\/production\/php &#8212; \u043f\u0443\u0442\u044c \u0434\u043e Dockerfile \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430<\/p>\n<\/li>\n<li>\n<p>gis\/certs &#8212; \u043f\u0443\u0442\u044c \u0434\u043e \u043f\u0430\u043f\u043e\u043a \u0441 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u043c<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u0412 \u0432\u0430\u0448\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0432\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u0434\u0435\u043b\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c openssl v1.1.1, \u0441 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 3.0 \u0443 \u043c\u0435\u043d\u044f \u043d\u0435\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f) \u043c\u043e\u0436\u0435\u0442 \u0434\u043e\u0431\u0440\u044b\u0435 \u043b\u044e\u0434\u0438 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0445 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443\u0442 \u043a\u0430\u043a \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u043d\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0438 \u0440\u0443\u0433\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0439\u0442\u0438 stunnel, \u0442\u043e \u043f\u043e\u0434\u043d\u0438\u043c\u0438\u0442\u0435 \u0432\u0435\u0440\u0441\u0438\u044e, \u0447\u0435\u043a\u043d\u0443\u0432 \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u043d\u0430 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0430\u0439\u0442\u0435. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0443 \u043d\u0438\u0445 \u043d\u0435\u0442 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0441\u0430\u043c\u0443\u044e \u0441\u0432\u0435\u0436\u0443\u044e \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0438 \u0435\u0441\u043b\u0438 \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u043d\u043e\u0432\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f, \u0442\u043e \u0441\u0441\u044b\u043b\u043a\u0438 \u0441\u043e \u0441\u0442\u0430\u0440\u044b\u043c\u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442 \u0432\u044b\u0434\u0430\u0432\u0430\u0442\u044c 404.<\/p>\n<\/li>\n<\/ul>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u044f \u043a \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430\u043c<\/h3>\n<p>\u041d\u0430\u043c \u043d\u0443\u0436\u043d\u044b \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0438 \u0437\u0430\u043a\u0440\u044b\u0442\u044b\u0439 \u043a\u043b\u044e\u0447. \u0418\u0437 \u041a\u0440\u0438\u043f\u0442\u043e\u041f\u0420\u041e \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 <code>cert.000<\/code>. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0438\u0434\u0451\u043c \u0441\u044e\u0434\u0430 \u0438, \u0441\u043b\u0435\u0434\u0443\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f\u043c, \u0434\u0435\u043b\u0430\u0435\u043c \u0441\u0435\u0431\u0435  \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 &#8212; <a href=\"https:\/\/github.com\/ddruganov\/get-cpcert\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/ddruganov\/get-cpcert<\/a>. \u041f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 <code>openssl x509 -in cert.crt -out cert.pem -outform PEM<\/code><\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435 \u043a \u043a\u0440\u0438\u043f\u0442\u043e\u0442\u0443\u043d\u043d\u0435\u043b\u044e<\/h3>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0447\u0435\u0440\u0435\u0437 \u043a\u0440\u0438\u043f\u0442\u043e\u0442\u0443\u043d\u043d\u0435\u043b\u044c, \u0432 php \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u043f\u0438\u043b\u0438\u0442\u044c SoapClient:<\/p>\n<pre><code class=\"php\">final class CustomSoapClient extends SoapClient {     private Closure $requestHandlerCallback;      public function __construct(string $wsdl, Closure $requestHandlerCallback)     {         $this->requestHandlerCallback = $requestHandlerCallback;          parent::__construct($wsdl, [             'trace' => true,             'exceptions' => false,             'use' => SOAP_LITERAL,             'style' => SOAP_DOCUMENT,         ]);     }      public function __doRequest(string $request, string $location, string $action, int $version, bool $oneWay = false): ?string     {         $request = ($this->requestHandlerCallback)($request);          $location = str_replace('https:\/\/api.dom.gosuslugi.ru', Yii::$app->params['gis']['tlsTunnelAddress'], $location);          $ch = curl_init();         curl_setopt_array($ch, [             CURLOPT_URL => $location,             CURLOPT_RETURNTRANSFER => true,             CURLOPT_POST => true,             CURLOPT_POSTFIELDS => $request,             CURLOPT_CONNECTTIMEOUT => 20,             CURLOPT_TIMEOUT => 20,             CURLOPT_HTTPHEADER => [                 \"SOAPAction: $action\"             ]         ]);          $response = curl_exec($ch);          curl_close($ch);          return $response;     } }<\/code><\/pre>\n<p>\u0412 \u044d\u0442\u043e\u043c \u043a\u043e\u0434\u0435 \u0441\u0430\u043c\u043e\u0435 \u0432\u0430\u0436\u043d\u043e\u0435 \u044d\u0442\u043e \u0441\u0442\u0440\u043e\u043a\u0430 21, \u0433\u0434\u0435 \u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u043f\u043e soap \u0438\u0434\u0451\u0442 \u0437\u0430\u043c\u0435\u043d\u0430 \u043f\u0440\u044f\u043c\u043e\u0433\u043e \u0430\u0434\u0440\u0435\u0441\u0430 \u0413\u0418\u0421 \u0416\u041a\u0425 \u043d\u0430 \u0430\u0434\u0440\u0435\u0441 \u043a\u0440\u0438\u043f\u0442\u043e\u0442\u0443\u043d\u043d\u0435\u043b\u044f<\/p>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u044f \u044d\u0442\u043e\u0442 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0435 \u0433\u043e\u0442\u043e\u0432\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d \u043a\u0440\u0438\u043f\u0442\u043e\u0442\u0443\u043d\u043d\u0435\u043b\u044c \u0438 openssl+gost \u0438 \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u044d\u0442\u043e \u0432\u0441\u0451 \u0447\u0442\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0447\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0413\u0418\u0421 \u0416\u041a\u0425<\/p>\n<p>\u041c\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0443\u0436\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u0435 \u043e\u043a\u043e\u043b\u043e 10 \u043c\u0435\u0441\u044f\u0446\u0435\u0432, \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044f \u0434\u043e 60\u043a \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u043c\u0435\u0441\u044f\u0446 \u0441 \u043a\u0440\u0430\u0439\u043d\u0435 \u0432\u0430\u0440\u0438\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u043e \u0434\u043d\u044f\u043c \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439, \u0437\u0430 \u044d\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u0441\u0431\u043e\u0435\u0432 \u043d\u0435 \u0431\u044b\u043b\u043e (\u0445\u043e\u0442\u044f \u0432\u043e\u043e\u0431\u0449\u0435-\u0442\u043e \u043e\u0442\u043a\u0443\u0434\u0430 \u0438\u043c \u0431\u044b\u0442\u044c, \u044d\u0442\u043e \u043d\u0435 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0430)<\/p>\n<p>\u0415\u0449\u0451 \u043e\u0434\u043d\u0430 \u0432\u0430\u0436\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0432\u0441\u0435\u0433\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u044d\u0442\u043e \u043f\u043e\u0434\u043f\u0438\u0441\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043f\u043e XMLDSig \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0432, \u043d\u043e \u043e\u0431 \u044d\u0442\u043e\u043c \u0447\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435, \u0442\u0430\u043a \u043a\u0430\u043a \u0442\u0430\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0438 \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u0431\u044b \u0435\u0433\u043e \u043e\u0444\u043e\u0440\u043c\u0438\u0442\u044c \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0434\u043b\u044f \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u044f \u0438\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e &#8212; \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0438\u0448\u0438\u0442\u0435, \u044f \u043e\u0431\u043d\u043e\u0432\u043b\u044e \u0433\u0430\u0439\u0434 \u0438 \u0432\u0441\u0451 \u043f\u043e\u044f\u0441\u043d\u044e. \u042f \u0441\u0430\u043c \u0434\u043e\u043b\u0433\u043e \u0432\u0441\u0451 \u044d\u0442\u043e \u0441\u043e\u0431\u0438\u0440\u0430\u043b, \u044f \u0437\u043d\u0430\u044e, \u0447\u0442\u043e \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043b\u044e\u0434\u0435\u0439 \u0441\u0442\u0440\u0430\u0434\u0430\u0435\u0442 \u0441 \u044d\u0442\u043e\u0439 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0435\u0439 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e (<a href=\"https:\/\/gitter.im\/springjazzy\/GIS_JKH_Integration\" rel=\"noopener noreferrer nofollow\">https:\/\/gitter.im\/springjazzy\/GIS_JKH_Integration<\/a>)<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p> <!----> <!----><\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/710462\/\"> https:\/\/habr.com\/ru\/post\/710462\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p><a href=\"https:\/\/habr.com\/en\/post\/300856\/\" rel=\"noopener noreferrer nofollow\">\u042d\u0442\u043e \u043e\u0434\u0430 \u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u043f\u043e\u0441\u0442\u0443<\/a>.<\/p>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0430 \u0434\u043b\u044f PHP, \u043d\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u0432\u0441\u0435\u0445.<\/p>\n<h3>\u041a\u043e\u043d\u0444\u0438\u0433\u0438<\/h3>\n<p>\u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u043c \u043e\u0431\u0449\u0430\u0442\u044c\u0441\u044f \u0441 \u0413\u0418\u0421 \u0416\u041a\u0425. \u0422\u0443\u0442 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d \u043a\u043e\u043d\u0444\u0438\u0433 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0441 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0441\u0442\u044c \u043b\u0438\u0448\u043d\u0438\u0435 (\u0434\u043b\u044f \u0432\u0430\u0441) \u043f\u0430\u043a\u0435\u0442\u044b<\/p>\n<p>\u041f\u043e\u043a\u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u0434\u0430<\/p>\n<pre><code>FROM php:8.1-fpm-alpine  # \u044d\u0442\u043e \u043d\u0435 \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u043e, \u043d\u043e \u043c\u043d\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f zsh RUN apk add zsh  # \u043f\u0430\u043a\u0435\u0442\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b openssl RUN apk add \\     git \\     alpine-sdk \\     cmake \\     wget \\     bash \\     libxml2-dev \\     libssl1.1 # \u043f\u0430\u043a\u0435\u0442\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 zip-\u0430\u0440\u0445\u0438\u0432\u0430\u043c\u0438; \u0431\u0443\u0434\u0443\u0442 \u043d\u0443\u0436\u043d\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 xml-\u0444\u0430\u0439\u043b\u0430\u043c\u0438 RUN apk add \\     libzip-dev \\     zip \\     unzip # \u043f\u0430\u043a\u0435\u0442\u044b \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f gd RUN apk add \\     libpng \\     libpng-dev \\     freetype-dev # postgres RUN apk add \\     postgresql-dev  # \u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0441 oracle ADD https:\/\/github.com\/mlocati\/docker-php-extension-installer\/releases\/latest\/download\/install-php-extensions \/usr\/local\/bin\/ RUN chmod +x \/usr\/local\/bin\/install-php-extensions RUN install-php-extensions oci8  # \u043a\u043e\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u0435\u043c php RUN docker-php-ext-configure zip RUN docker-php-ext-configure gd --with-freetype RUN docker-php-ext-install soap pdo pdo_pgsql zip bcmath gd intl  # composer RUN php -r \"copy('https:\/\/getcomposer.org\/installer', 'composer-setup.php');\" RUN php composer-setup.php RUN php -r \"unlink('composer-setup.php');\" RUN mv composer.phar \/usr\/local\/bin\/composer  # \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0434\u0432\u0438\u0436\u043a\u0430 \u0413\u041e\u0421\u0422 \u0434\u043b\u044f openssl WORKDIR \/opt COPY docker\/production\/php\/openssl_gost.conf \/opt\/openssl_gost.conf RUN git clone --branch=openssl_1_1_1 https:\/\/github.com\/gost-engine\/engine.git gost-engine WORKDIR \/opt\/gost-engine RUN mkdir build WORKDIR \/opt\/gost-engine\/build RUN cmake -DCMAKE_BUILD_TYPE=Release -DOPENSSL_ROOT_DIR=\/usr\/ssl -DOPENSSL_LIBRARIES=\/usr\/ssl\/lib -DOPENSSL_ENGINES_DIR=\/usr\/ssl\/lib\/engines-3 .. RUN cmake --build . --config Release RUN cmake --build . --target install --config Release # \u043d\u0430 \u043c\u043e\u0435\u0439 \u043c\u0430\u0448\u0438\u043d\u0435 openssl \u043b\u0435\u0436\u0438\u0442 \u0432 \u043f\u0430\u043f\u043a\u0435 \/etc\/ssl, \u043d\u0430 \u043f\u0440\u043e\u0434\u0435 \u0432 \u043f\u0430\u043f\u043a\u0435 \/etc\/ssl1.1 - \u043d\u0435 \u0441\u0442\u0430\u043b \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u0447\u0435\u043c\u0443 RUN OPENSSL_DIRECTORY=\"$([[ -d \/etc\/ssl1.1 ]] &amp;&amp; echo '\/etc\/ssl1.1' || echo '\/etc\/ssl')\" &amp;&amp; \\     sed -i '1s;^;openssl_conf = openssl_def\\n;' \"$OPENSSL_DIRECTORY\/openssl.cnf\" &amp;&amp; \\     cat \/opt\/openssl_gost.conf >> \"$OPENSSL_DIRECTORY\/openssl.cnf\"  # \u0441\u0442\u0430\u0432\u0438\u043c \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u044b \u0434\u043b\u044f stunnel COPY docker\/production\/php\/stunnel.conf \/etc\/stunnel.conf RUN mkdir -p \/etc\/crypto # \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u0441\u0442\u0435\u043d\u0434\u0430 \u0413\u0418\u0421 \u0416\u041a\u0425 COPY gis\/certs\/ca-ppak.pem \/etc\/crypto\/ca-ppak.pem # \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u0432\u0430\u0448\u0435\u0433\u043e \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430 COPY gis\/certs\/certificate.pem \/etc\/crypto\/certificate.pem # \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u0432\u0430\u0448\u0435\u0433\u043e \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430 COPY gis\/certs\/private.key \/etc\/crypto\/private.key RUN chmod -R 700 \/etc\/crypto  # \u0441\u0442\u0430\u0432\u0438\u043c \u0441\u0430\u043c stunnel WORKDIR \/opt RUN wget https:\/\/www.stunnel.org\/downloads\/stunnel-5.66.tar.gz -O stunnel.tar.gz RUN tar -xvf stunnel.tar.gz WORKDIR \/opt\/stunnel-5.66 RUN sed -i '4745 i SSL_library_init();' src\/options.c RUN .\/configure --disable-libwrap RUN make &amp;&amp; make install  # \u0431\u0443\u0442\u0441\u0442\u0440\u0430\u043f\u0438\u043c cron COPY docker\/production\/php\/crontab \/opt\/crontab RUN chmod 0644 \/opt\/crontab &amp;&amp; crontab \/opt\/crontab RUN crond  WORKDIR \/app  # \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0432\u0441\u0435 \u043d\u0443\u0436\u043d\u044b\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b COPY docker\/production\/php\/startup.sh \/opt\/startup.sh RUN chmod +x \/opt\/startup.sh CMD [\"\/opt\/startup.sh\"] <\/code><\/pre>\n<p>\u041d\u0430 \u0441\u0442\u0440\u043e\u043a\u0435 47 \u0441\u0441\u044b\u043b\u0430\u044e\u0441\u044c \u043d\u0430 openssl_gost.conf, \u0432\u043e\u0442 \u043e\u043d:<\/p>\n<pre><code># gost support [openssl_def] engines = engine_section  [engine_section] gost = gost_section  [gost_section] engine_id = gost dynamic_path = \/usr\/ssl\/lib\/engines-3\/gost.so default_algorithms = ALL CRYPT_PARAMS = id-Gost28147-89-CryptoPro-A-ParamSet<\/code><\/pre>\n<p>\u041d\u0430 \u0441\u0442\u0440\u043e\u043a\u0435 89 \u0441\u0441\u044b\u043b\u0430\u044e\u0441\u044c \u043d\u0430 \/opt\/startup.sh, \u0432\u043e\u0442 \u043e\u043d:<\/p>\n<pre><code>stunnel \/etc\/stunnel.conf php-fpm<\/code><\/pre>\n<p>\u0413\u0434\u0435 stunnel.conf \u044d\u0442\u043e:<\/p>\n<pre><code>socket=lsocket=l:TCP_NODELAY=1 socket=r:TCP_NODELAY=1  CAFile=\/etc\/crypto\/ca-ppak.pem engine=gost sslVersion=TLSv1 engineDefault=ALL  output=\/var\/log\/stunnel.log DEBUG=7  client=yes  [pseudo-https] accept=127.0.0.1:3000 connect=api.dom.gosuslugi.ru:443 ciphers=GOST2012-GOST8912-GOST8912 verify=0 TIMEOUTclose=0 cert=\/etc\/crypto\/certificate.pem key=\/etc\/crypto\/private.keyTCP_NODELAY=1socket=r:TCP_NODELAY=1CAFile=\/etc\/crypto\/ca-ppak.pemengine=gostsslVersion=TLSv1engineDefault=ALLoutput=\/var\/log\/stunnel.logDEBUG=7client=yes[pseudo-https]accept=127.0.0.1:3000connect=api.dom.gosuslugi.ru:443ciphers=GOST2012-GOST8912-GOST8912verify=0TIMEOUTclose=0cert=\/etc\/crypto\/certificate.pemkey=\/etc\/crypto\/private.key<\/code><\/pre>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u044f \u043a \u043a\u043e\u043d\u0444\u0438\u0433\u0430\u043c<\/h3>\n<ul>\n<li>\n<p>\u041f\u0443\u0442\u0438 \u0434\u043e \u0444\u0430\u0439\u043b\u043e\u0432, \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0435 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a\u043e\u0440\u043d\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430:<\/p>\n<ul>\n<li>\n<p>docker\/production\/php &#8212; \u043f\u0443\u0442\u044c \u0434\u043e Dockerfile \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430<\/p>\n<\/li>\n<li>\n<p>gis\/certs &#8212; \u043f\u0443\u0442\u044c \u0434\u043e \u043f\u0430\u043f\u043e\u043a \u0441 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u043c<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u0412 \u0432\u0430\u0448\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0432\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u0434\u0435\u043b\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c openssl v1.1.1, \u0441 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 3.0 \u0443 \u043c\u0435\u043d\u044f \u043d\u0435\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f) \u043c\u043e\u0436\u0435\u0442 \u0434\u043e\u0431\u0440\u044b\u0435 \u043b\u044e\u0434\u0438 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0445 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443\u0442 \u043a\u0430\u043a \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u043d\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0438 \u0440\u0443\u0433\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0439\u0442\u0438 stunnel, \u0442\u043e \u043f\u043e\u0434\u043d\u0438\u043c\u0438\u0442\u0435 \u0432\u0435\u0440\u0441\u0438\u044e, \u0447\u0435\u043a\u043d\u0443\u0432 \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u043d\u0430 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0430\u0439\u0442\u0435. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0443 \u043d\u0438\u0445 \u043d\u0435\u0442 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0441\u0430\u043c\u0443\u044e \u0441\u0432\u0435\u0436\u0443\u044e \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0438 \u0435\u0441\u043b\u0438 \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u043d\u043e\u0432\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f, \u0442\u043e \u0441\u0441\u044b\u043b\u043a\u0438 \u0441\u043e \u0441\u0442\u0430\u0440\u044b\u043c\u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442 \u0432\u044b\u0434\u0430\u0432\u0430\u0442\u044c 404.<\/p>\n<\/li>\n<\/ul>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u044f \u043a \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430\u043c<\/h3>\n<p>\u041d\u0430\u043c \u043d\u0443\u0436\u043d\u044b \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0438 \u0437\u0430\u043a\u0440\u044b\u0442\u044b\u0439 \u043a\u043b\u044e\u0447. \u0418\u0437 \u041a\u0440\u0438\u043f\u0442\u043e\u041f\u0420\u041e \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 <code>cert.000<\/code>. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0438\u0434\u0451\u043c \u0441\u044e\u0434\u0430 \u0438, \u0441\u043b\u0435\u0434\u0443\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f\u043c, \u0434\u0435\u043b\u0430\u0435\u043c \u0441\u0435\u0431\u0435  \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 &#8212; <a href=\"https:\/\/github.com\/ddruganov\/get-cpcert\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/ddruganov\/get-cpcert<\/a>. \u041f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 <code>openssl x509 -in cert.crt -out cert.pem -outform PEM<\/code><\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435 \u043a \u043a\u0440\u0438\u043f\u0442\u043e\u0442\u0443\u043d\u043d\u0435\u043b\u044e<\/h3>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0447\u0435\u0440\u0435\u0437 \u043a\u0440\u0438\u043f\u0442\u043e\u0442\u0443\u043d\u043d\u0435\u043b\u044c, \u0432 php \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u043f\u0438\u043b\u0438\u0442\u044c SoapClient:<\/p>\n<pre><code class=\"php\">final class CustomSoapClient extends SoapClient {     private Closure $requestHandlerCallback;      public function __construct(string $wsdl, Closure $requestHandlerCallback)     {         $this->requestHandlerCallback = $requestHandlerCallback;          parent::__construct($wsdl, [             'trace' => true,             'exceptions' => false,             'use' => SOAP_LITERAL,             'style' => SOAP_DOCUMENT,         ]);     }      public function __doRequest(string $request, string $location, string $action, int $version, bool $oneWay = false): ?string     {         $request = ($this->requestHandlerCallback)($request);          $location = str_replace('https:\/\/api.dom.gosuslugi.ru', Yii::$app->params['gis']['tlsTunnelAddress'], $location);          $ch = curl_init();         curl_setopt_array($ch, [             CURLOPT_URL => $location,             CURLOPT_RETURNTRANSFER => true,             CURLOPT_POST => true,             CURLOPT_POSTFIELDS => $request,             CURLOPT_CONNECTTIMEOUT => 20,             CURLOPT_TIMEOUT => 20,             CURLOPT_HTTPHEADER => [                 \"SOAPAction: $action\"             ]         ]);          $response = curl_exec($ch);          curl_close($ch);          return $response;     } }<\/code><\/pre>\n<p>\u0412 \u044d\u0442\u043e\u043c \u043a\u043e\u0434\u0435 \u0441\u0430\u043c\u043e\u0435 \u0432\u0430\u0436\u043d\u043e\u0435 \u044d\u0442\u043e \u0441\u0442\u0440\u043e\u043a\u0430 21, \u0433\u0434\u0435 \u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u043f\u043e soap \u0438\u0434\u0451\u0442 \u0437\u0430\u043c\u0435\u043d\u0430 \u043f\u0440\u044f\u043c\u043e\u0433\u043e \u0430\u0434\u0440\u0435\u0441\u0430 \u0413\u0418\u0421 \u0416\u041a\u0425 \u043d\u0430 \u0430\u0434\u0440\u0435\u0441 \u043a\u0440\u0438\u043f\u0442\u043e\u0442\u0443\u043d\u043d\u0435\u043b\u044f<\/p>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u044f \u044d\u0442\u043e\u0442 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0435 \u0433\u043e\u0442\u043e\u0432\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d \u043a\u0440\u0438\u043f\u0442\u043e\u0442\u0443\u043d\u043d\u0435\u043b\u044c \u0438 openssl+gost \u0438 \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u044d\u0442\u043e \u0432\u0441\u0451 \u0447\u0442\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0447\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0413\u0418\u0421 \u0416\u041a\u0425<\/p>\n<p>\u041c\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0443\u0436\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u0435 \u043e\u043a\u043e\u043b\u043e 10 \u043c\u0435\u0441\u044f\u0446\u0435\u0432, \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044f \u0434\u043e 60\u043a \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u043c\u0435\u0441\u044f\u0446 \u0441 \u043a\u0440\u0430\u0439\u043d\u0435 \u0432\u0430\u0440\u0438\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u043e \u0434\u043d\u044f\u043c \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439, \u0437\u0430 \u044d\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u0441\u0431\u043e\u0435\u0432 \u043d\u0435 \u0431\u044b\u043b\u043e (\u0445\u043e\u0442\u044f \u0432\u043e\u043e\u0431\u0449\u0435-\u0442\u043e \u043e\u0442\u043a\u0443\u0434\u0430 \u0438\u043c \u0431\u044b\u0442\u044c, \u044d\u0442\u043e \u043d\u0435 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0430)<\/p>\n<p>\u0415\u0449\u0451 \u043e\u0434\u043d\u0430 \u0432\u0430\u0436\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0432\u0441\u0435\u0433\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u044d\u0442\u043e \u043f\u043e\u0434\u043f\u0438\u0441\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043f\u043e XMLDSig \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0432, \u043d\u043e \u043e\u0431 \u044d\u0442\u043e\u043c \u0447\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435, \u0442\u0430\u043a \u043a\u0430\u043a \u0442\u0430\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0438 \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u0431\u044b \u0435\u0433\u043e \u043e\u0444\u043e\u0440\u043c\u0438\u0442\u044c \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0434\u043b\u044f \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u044f \u0438\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e &#8212; \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0438\u0448\u0438\u0442\u0435, \u044f \u043e\u0431\u043d\u043e\u0432\u043b\u044e \u0433\u0430\u0439\u0434 \u0438 \u0432\u0441\u0451 \u043f\u043e\u044f\u0441\u043d\u044e. \u042f \u0441\u0430\u043c \u0434\u043e\u043b\u0433\u043e \u0432\u0441\u0451 \u044d\u0442\u043e \u0441\u043e\u0431\u0438\u0440\u0430\u043b, \u044f \u0437\u043d\u0430\u044e, \u0447\u0442\u043e \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043b\u044e\u0434\u0435\u0439 \u0441\u0442\u0440\u0430\u0434\u0430\u0435\u0442 \u0441 \u044d\u0442\u043e\u0439 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0435\u0439 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e (<a href=\"https:\/\/gitter.im\/springjazzy\/GIS_JKH_Integration\" rel=\"noopener noreferrer nofollow\">https:\/\/gitter.im\/springjazzy\/GIS_JKH_Integration<\/a>)<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p> <!----> <!----><\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/710462\/\"> https:\/\/habr.com\/ru\/post\/710462\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-343900","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/343900","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=343900"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/343900\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=343900"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=343900"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=343900"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}