PHP 8.4.0 RC3 available for testing

Настройка во время выполнения

Поведение функций зависит от установок в файле php.ini.

Опции настройки openssl
Имя По умолчанию Место изменения Список изменений
openssl.cafile "" INI_PERDIR  
openssl.capath "" INI_PERDIR  
Дополнительную информацию и определения режимов INI_* даёт раздел «Места установки параметров конфигурации».

Краткое разъяснение конфигурационных директив.

openssl.cafile string

Местоположение файла Certificate Authority на локальной файловой системе, который должен использоваться с опцией контекста verify_peer для аутентификации удалённой точки.

openssl.capath string

Если cafile не задан или сертификат не найден, то директория, указанная в capath будет использована для поиска сертификата. capath должна быть корректно хешированной директорией сертификата.

Также смотрите опции контекста потока SSL.

Добавить

Примечания пользователей 2 notes

up
1
mmi at uhb-consulting dot de
6 years ago
in capath the Certificates must be placed with the certificates hash as name and .0 as Ending.

Here is how to get the hashes from Certificates lying in this folder and automatically rename them in a correct way:
<?php
$paths
=openssl_get_cert_locations();
$allowed=array("cer","crt","pem");
if (!empty(
$paths['ini_capath'])){
$capathDirectory = dir($paths['ini_capath']);
while (
false !== ($entry = $capathDirectory->read())) {
$Sourcefile=$paths['ini_capath']."/".$entry;
if (
file_exists( $Sourcefile)){
$path_parts = pathinfo($Sourcefile);
if (
in_array(strtolower($path_parts['extension']),$allowed)){
$ParsedCertificatePbject = openssl_x509_parse(file_get_contents($Sourcefile));
$Sourcefile= $ParsedCertificatePbject["hash"].".0";
$TargetFilename = dirname($Sourcefile)."/".$Sourcefile;
if (!
file_exists($TargetFilename)) {
rename ($Sourcefile ,$TargetFilename);
}
}
}
}
$capathDirectory->close();
}
?>
up
0
ofrick at bluewin dot ch
6 years ago
above code should be corrected to:

$Destfile= $ParsedCertificatePbject["hash"].".0";
$TargetFilename = dirname($Sourcefile)."/".$Destfile;
To Top