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

deps: Require ext-openssl #541

Merged
merged 1 commit into from
Mar 15, 2024
Merged

Conversation

tienvx
Copy link
Contributor

@tienvx tienvx commented Mar 14, 2024

  • Look like ext-openssl is required in <= v8 because we call file_get_contents with https scheme 50140a5
        $uri  = "https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v1.29.2/{$fileName}";
        $data = \file_get_contents($uri);
  • v9 + v10 use composer to download files with https scheme. Composer will "require" ext-openssl for us, by throwing an exception if it's not available https://github.com/composer/composer/blob/main/src/Composer/Downloader/FileDownloader.php#L468-L470
        if (!extension_loaded('openssl') && 0 === strpos($url, 'https:')) {
            throw new \RuntimeException('You must enable the openssl extension to download files via https');
        }
  • I think not requiring ext-openssl is not wrong. But requiring ext-openssl is also fine. So I added it again.
  • openssl extension is bundled into PHP, and I can't disable it to test

Copy link
Collaborator

@Lewiscowles1986 Lewiscowles1986 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. Relying on internals of a third party system vs explicitly calling out needs ftw.

@tienvx tienvx merged commit 11856c2 into pact-foundation:ffi Mar 15, 2024
26 checks passed
@tienvx tienvx deleted the require-openssl branch March 15, 2024 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants