Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove cacert installation for Windows #201

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ GOLANGCI_LINT_VERSION=v1.59
internal/legacy/archives/platform.phar:
curl -L https://github.com/platformsh/legacy-cli/releases/download/v$(LEGACY_CLI_VERSION)/platform.phar -o internal/legacy/archives/platform.phar

internal/legacy/archives/php_windows_amd64: internal/legacy/archives/php_windows.zip internal/legacy/archives/cacert.pem
internal/legacy/archives/php_windows_amd64: internal/legacy/archives/php_windows.zip

internal/legacy/archives/php_darwin_$(GOARCH):
bash build-php-brew.sh $(GOOS) $(PHP_VERSION) $(OPENSSL_VERSION)
Expand All @@ -53,11 +53,6 @@ internal/legacy/archives/php_windows.zip:
mkdir -p internal/legacy/archives
wget https://windows.php.net/downloads/releases/php-$(PHP_VERSION)-nts-Win32-vs16-x64.zip -O internal/legacy/archives/php_windows.zip

.PHONY: internal/legacy/archives/cacert.pem
internal/legacy/archives/cacert.pem:
mkdir -p internal/legacy/archives
wget https://curl.se/ca/cacert.pem -O internal/legacy/archives/cacert.pem

php: $(PHP_BINARY_PATH)

.PHONY: goreleaser
Expand Down
2 changes: 1 addition & 1 deletion internal/legacy/archives/windows_php.ini.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -1924,7 +1924,7 @@ ldap.max_links = -1
; OS-managed cert stores in its absence. If specified, this value may still
; be overridden on a per-stream basis via the "cafile" SSL stream context
; option.
openssl.cafile = "{{ .CLIDir }}\php\extras\cacert.pem"
;openssl.cafile=

; If openssl.cafile is not specified or if the CA file is not found, the
; directory pointed to by openssl.capath is searched for a suitable
Expand Down
6 changes: 1 addition & 5 deletions internal/legacy/php_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ var phpCLI []byte
//go:embed archives/windows_php.ini.tpl
var phpIniTemplate string

//go:embed archives/cacert.pem
var caCert []byte

// copyPHP to destination, if it does not exist
func (c *CLIWrapper) copyPHP() error {
dest := path.Join(c.cacheDir(), "php")
Expand Down Expand Up @@ -66,8 +63,7 @@ func (c *CLIWrapper) copyPHP() error {
return fmt.Errorf("could not open php.ini file for writing: %w", err)
}
defer w.Close()
template.Must(template.New("php.ini").Parse(phpIniTemplate)).Execute(w, map[string]string{"CLIDir": c.cacheDir()})
copyFile(path.Join(c.cacheDir(), "php", "extras", "cacert.pem"), caCert)
template.Must(template.New("php.ini").Parse(phpIniTemplate)).Execute(w, nil)

return nil
}
Expand Down
Loading