【问题标题】:PHP script halts with no errors when using openssl使用 openssl 时 PHP 脚本停止且没有错误
【发布时间】:2018-05-22 18:29:15
【问题描述】:

以下脚本在openssl_get_cipher_methods() 调用处停止,没有任何错误。它最初是通过openssl_decrypt() 调用来执行此操作的。

<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

echo extension_loaded('openssl') . '<br>';

print_r(openssl_get_cipher_methods());

echo '<br>end';

返回:

1

这可能是托管服务的问题吗?脚本输出表明模块已加载,phpinfo() 返回:

openssl
OpenSSL support     enabled
OpenSSL Version     OpenSSL 1.0.2k-fips 26 Jan 2017 

【问题讨论】:

    标签: php apache openssl


    【解决方案1】:

    openSSL 的 FIPS 版本有点特殊。除其他外,他们似乎没有openssl_get_cipher_methods。 FIPS 构建适用于必须遵守严格的加密规则的系统,其中代码必须是极简的,以保持可证明的相同。

    https://wiki.openssl.org/index.php/FIPS_Build_Guidelines

    请参见此处的第 47-53 行:https://github.com/defuse/php-encryption/blob/master/src/RuntimeTests.php

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-07-15
      • 2021-03-17
      • 2019-11-28
      • 2011-01-06
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多