Skip to content

native:install silently swallows SSL errors — "Failed to fetch versions manifest" hides the real cause #166

Description

@GustavoSimao

What were you trying to do?

Running php artisan native:install to set up NativePHP Mobile in my Laravel project.

What happened?

The installer failed with the generic message "Failed to fetch versions manifest from: https://bin.nativephp.com/main/versions.json".

The actual error is:
cURL error 60: SSL certificate OpenSSL verify result: unable to get local issuer certificate

PHP installed via WinGet does not configure curl.cainfo/openssl.cafile in php.ini, but native:install does not detect this — it swallows the exception and shows a message that gives no indication of how to fix the problem.

How to reproduce the bug

  1. Install PHP 8.4 via WinGet (leaves curl.cainfo and openssl.cafile empty in php.ini)
  2. laravel new test && cd test
  3. composer require nativephp/mobile
  4. php artisan native:install

Result: "Failed to fetch versions manifest" with no indication that the problem is SSL.

Debug Output

php artisan native:debug

+--------------------+---------------+
| Package Version | 3.3.6 |
| PHP Version (Host) | 8.4.20 |
| OS | Windows |
| OS Version | 10.0 |
| Embedded PHP | Not installed |
+--------------------+---------------+

+----------------+--------------------------------------+
| Android Studio | Not found |
| Gradle | Not found |
| Java | java version "25.0.2" 2026-01-20 LTS |
+----------------+--------------------------------------+

Which operating systems have you seen this occur on?

Windows

Which platforms were you trying to build for?

Android (Emulator)

Notes

The error is in InstallCommand.php, method fetchVersionsManifest():

try {
$this->versionsManifest = json_decode(
(new Client)->get($versionsUrl)->getBody()->getContents(),
true
);
} catch (RequestException $e) {
error("Failed to fetch versions manifest from: {$versionsUrl}");
}

The exception $e is swallowed. It should either show the real error message
or detect that curl.cainfo is not configured and instruct the user to fix it.

Workaround: add to php.ini:
curl.cainfo = "C:\path\to\cacert.pem"
openssl.cafile = "C:\path\to\cacert.pem"

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions