Skip to content

Commit

Permalink
Add OpenSSL config on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
shivammathur committed Feb 12, 2022
1 parent 5bf95cd commit 7ad352e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/scripts/win32.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,17 @@ Function Add-PhpCAInfo {
}
}

# Function to set OpenSSL config.
Function Add-OpenSSLConf {
try {
Set-OpenSSLConf -Target User
} catch {
New-Item $php_dir\extras\openssl.cnf -Type File -Force > $null 2>&1
Set-OpenSSLConf -Path $php_dir\extras\openssl.cnf -Target User
}
Add-Env -EnvName OPENSSL_CONF -EnvValue $env:OPENSSL_CONF

This comment has been minimized.

Copy link
@mlocati

mlocati Feb 14, 2022

Contributor

IMHO this line may be superfluous: Set-OpenSSLConf -Target User should already set the OPENSSL_CONF environment variable for the current user

This comment has been minimized.

Copy link
@shivammathur

shivammathur Feb 14, 2022

Author Owner

After testing I found that It does not load the environment variable from the registry in the next workflow steps. So the only solution I could find was to add the env to the Profile or GITHUB_ENV.

Test: https://github.com/shivammathur/test-setup-php/runs/5180365218?check_suite_focus=true

}

# Function to set PHP config.
Function Add-PhpConfig {
$current = Get-Content -Path $php_dir\php.ini-current -ErrorAction SilentlyContinue
Expand Down Expand Up @@ -348,6 +359,7 @@ if($version -lt "5.5") {
}
Enable-PhpExtension -Extension $enable_extensions -Path $php_dir
Add-PhpCAInfo
Add-OpenSSLConf
Copy-Item -Path $src\configs\pm\*.json -Destination $env:RUNNER_TOOL_CACHE
Set-Output php-version $($installed.FullVersion)
Add-Log $tick "PHP" "$status PHP $($installed.FullVersion)$extra_version"

0 comments on commit 7ad352e

Please sign in to comment.