AWS SSL security error : [curl] 60: SSL certificate prob...: unable to get local issuer certificate

AWS SSL security error : [curl] 60: SSL certificate prob...: unable to get local issuer certificate

  1. Blog
  2. 15 November 2026
  3. 4 min read

Stefan Bogdanescu

Founder & Senior Architect

Resolving "unable to get local issuer certificate" Errors on Windows with Amazon S3

Encountering a curl error like [curl] 60: SSL certificate problem: unable to get local issuer certificate when connecting to AWS S3 from a Windows localhost is a classic friction point between the operating system's default trust store and modern TLS handshakes. While this issue often surfaces in Linux environments, Windows developers frequently run into it because of how the underlying C runtime initializes SSL contexts.

When you execute a script on your machine that successfully hits an EC2 instance but fails against s3.amazonaws.com, the discrepancy usually points to missing CA (Certificate Authority) certificates or a misconfigured OpenSSL backend rather than the application logic itself. In the scenario described, the developer attempted to resolve this by manually downloading cacert.pem from curl.haxx.se and setting it via curl.cainfo in php.ini. While valid on many platforms, Windows-specific configurations often require additional steps for this directive to take effect immediately without restarting the web server or application pool.

Why the Standard Approach Fails on Windows

The root cause of this specific error is typically that the system's default CA bundle is outdated or missing entirely for certain root authorities used by AWS. When you run the command line curl tool directly, it defaults to a bundled certificate store that might be different from what Apache uses. On Windows, the Apache build often relies on the Microsoft WinSSL (Schannel) provider unless explicitly compiled with OpenSSL.

If your PHP installation is built against Schannel, the curl.cainfo directive in php.ini may be ignored because Schannel relies on its own trust store (ROOTCERT.DAT) rather than a PEM file. This explains why checking ini_get("curl.cainfo") returns the correct path while the error persists; the runtime isn't reading that file for validation.

To fix this without rebuilding PHP, you must ensure the certificate bundle is loaded by the SSL backend Apache is actually using. If you are stuck with the default Windows SSL provider, the most reliable workaround is to bypass the strict verification locally or update the system's root certificates. However, for a production-grade solution that maintains security, switching your PHP and Apache builds to use OpenSSL is highly recommended.

Implementing the Correct CA Bundle

If you cannot switch your build to OpenSSL immediately, try using curl's built-in option to pass the certificate directly during runtime rather than relying solely on php.ini. Modify your Guzzle or AWS SDK request to include the CA bundle explicitly:

use Aws\S3\S3Client;
use GuzzleHttp\Client;

$client = new Client([
    'verify' => true, 
    'cafile' => 'C:/AppServ/cacert.pem', // Ensure this path is absolute and accessible
]);

// Or if using the AWS SDK directly with custom config
$s3Client = new S3Client([
    'region' => 'us-east-1',
    'version' => 'latest',
    'ca_file' => 'C:/AppServ/cacert.pem', // Supported in newer Guzzle/AWS SDK versions
]);

Note that older versions of the AWS SDK for PHP might not support the ca_file option directly in the client constructor; in those cases, you must rely on the system's configuration.

Updating System Trust Stores

If your environment uses Schannel, updating the root certificates stored in Windows is often more effective than pointing PHP to a custom file. Run the following command in an elevated PowerShell or Command Prompt:

certutil -addstore Root "C:/AppServ/cacert.pem"

This command adds the CA bundle from your local cacert.pem into the Windows system store. Once this is done, restart Apache and retry the connection. This approach ensures that both your CLI tools and your web server share the same trusted root authority list.

Trade-offs and Best Practices

Disabling SSL verification entirely (e.g., setting verify: false) should never be used in production or even in local development unless it is strictly for debugging. It opens you to Man-in-the-Middle attacks and violates security best practices. The goal is always to have a valid, up-to-date trust store that covers AWS’s current certificate hierarchy.

If you are building new applications on Windows with PHP, consider using the XAMPP or WAMP distributions that bundle OpenSSL by default, or ensure your php.ini points to an OpenSSL-based binary. This eliminates the Schannel compatibility issue entirely and aligns your local development environment with the production infrastructure where you deploy.

For ongoing maintenance, keep your cacert.pem file updated regularly, as AWS rotates its certificates frequently. You can automate this by setting up a scheduled task to fetch the latest bundle from http://curl.haxx.se/ca/cacert.pem and refresh your store accordingly.

Our network