# DevKinsta Localhost: cURL error 60: SSL certificate problem

**URL:** https://community.kinsta.com/t/devkinsta-localhost-curl-error-60-ssl-certificate-problem/3615
**Category:** Application Support
**Created:** [June 20, 2024, 7:12pm UTC](https://community.kinsta.com/t/devkinsta-localhost-curl-error-60-ssl-certificate-problem/3615 "2024-06-20T19:12:58Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![kjosern](https://avatars.discourse-cdn.com/v4/letter/k/b9e5f3/32.png) [@kjosern](https://community.kinsta.com/u/kjosern)
#### Post date: [June 20, 2024, 7:12pm UTC](https://community.kinsta.com/t/devkinsta-localhost-curl-error-60-ssl-certificate-problem/3615/1 "2024-06-20T19:12:58Z")

</div>

I would love more information on the error given by query monitor. Ideally a fix.

The error:  
cURL error 60: SSL certificate problem: unable to get local issuer certificate

PHP: Version 8.0.30  
WP: Version 6.5.4

Plugins include and limited to:  
**Query Monitor**  
**WP-Optimize - Clean, Compress, Cache**

Theme:  
**Bricks Builder**

Context:  
Query monitor error, HTTP API Calls:  
Method: GET  
URL: [https://exmaple.local/wp-content/themes/bricks/style.css](https://exmaple.local/wp-content/themes/bricks/style.css)  
Status: cURL error 60: SSL certificate problem: unable to get local issuer certificate  
Caller: `WP_Optimize->get_stylesheet_headers()`  
Component: Plugin: wp-optimize

The error happens when you go to the wp optimize plugin:  
[https://exmaple.local/wp-admin/admin.php?page=WP-Optimize](https://exmaple.local/wp-admin/admin.php?page=WP-Optimize)

I have a clean wordpress install hosted locally using devkinsta.

Hello.

This is no major concern at all, i just want to be enlighten. It just annoy me that i cannot fix it. There is no error if i disable https at devkinsta.

Thank you for any feedback.

---

<div class="post-metadata">

### Author: ![Adrian\_L](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/adrian_l/32/2810_2.png) [@Adrian\_L](https://community.kinsta.com/u/Adrian_L)
#### Post date: [June 20, 2024, 11:51pm UTC](https://community.kinsta.com/t/devkinsta-localhost-curl-error-60-ssl-certificate-problem/3615/2 "2024-06-20T23:51:28Z")

</div>

Hi @kjosern 👋

Welcome to the Kinsta Community!

You might encounter the error “_ **cURL error 60: SSL certificate problem: unable to get local issuer certificate** _” because the Devkinsta app uses a self-signed SSL certificate only. If you use **curl -k** to bypass SSL, it should provide the correct **curl** output. I am not sure, though, if this is doable within the optimize plugin. But you can check out the screenshot below as an example:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/kinsta/original/2X/c/caaf69a2a5e11e9a23c91c6ce4bc64e288a3e2ac.png)

You can also refer to this lengthy discussion thread for possible workarounds to bypass this self-signed SSL limitation:

> [@DevKinsta 2.8.0 SSL Certificate Not Valid](https://community.kinsta.com/t/devkinsta-2-8-0-ssl-certificate-not-valid/1852/8):
>
> Kevin, I’m on Big Sur 11.6 and did not change versions before the issue started. I’ve also found a workaround for Firefox If you go to Firefox \> Preferences \> Privacy & Security you can add the server as an exception Clicking View Certificates as seen in screenshot will allow you add the full domain name (including port value if different) as an exception which so far allows me to bypass the warning in browser.

I hope that you find this information helpful. 🙂

---

<div class="post-metadata">

### Author: ![kjosern](https://avatars.discourse-cdn.com/v4/letter/k/b9e5f3/32.png) [@kjosern](https://community.kinsta.com/u/kjosern)
#### Post date: [June 21, 2024, 2:28pm UTC](https://community.kinsta.com/t/devkinsta-localhost-curl-error-60-ssl-certificate-problem/3615/3 "2024-06-21T14:28:58Z")

</div>

Hi thank you for the insight! I guess it would work, but i might just turn of https inside devkinsta instead, as it is easier to manage for me.

 ![Skjermbilde 2024-06-21 kl. 16.24.55](https://us1.discourse-cdn.com/flex020/uploads/kinsta/original/2X/0/026a4b6da3c6aaf2b546fc04db72631f1b6a476a.png)

Follow up question, will this affect production or cause any problems developing on none ssl?

Again, thank you so much for your time to reply to me.

---

<div class="post-metadata">

### Author: ![Andrew](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/andrew/32/2792_2.png) [@Andrew](https://community.kinsta.com/u/Andrew)
#### Post date: [June 22, 2024, 1:51am UTC](https://community.kinsta.com/t/devkinsta-localhost-curl-error-60-ssl-certificate-problem/3615/4 "2024-06-22T01:51:42Z")

</div>

Hi @kjosern! Thank you for your reply!

Disabling SSL and HTTPS within DevKinsta should allow you to make insecure connections via HTTP to the local development site. This should not cause problems during the development process. Once you have pushed the site from DevKinsta to a staging environment in MyKinsta where a valid SSL certificate is installed, you can run a search and replace to search for “[http://staging-domain-name](http://staging-domain-name)” and replace it with “[https://staging-domain-name](https://staging-domain-name)” to ensure that all links have been updated from HTTP to HTTPS.

You may find a link to our help article below that goes over how to use the search and replace tool in MyKinsta:

> **[Tools - Search and Replace - Kinsta® Docs](https://kinsta.com/docs/wordpress-hosting/mykinsta-tools/mykinsta-search-replace-tool/)**
>
> In this article, we'll show you how to use the search and replace tool in MyKinsta effectively with tips and examples.

If you do have any questions please don’t hesitate to reply! We are standing by and happy to help!

Best regards

---

<div class="post-metadata">

### Author: ![kjosern](https://avatars.discourse-cdn.com/v4/letter/k/b9e5f3/32.png) [@kjosern](https://community.kinsta.com/u/kjosern)
#### Post date: [June 24, 2024, 2:28pm UTC](https://community.kinsta.com/t/devkinsta-localhost-curl-error-60-ssl-certificate-problem/3615/5 "2024-06-24T14:28:59Z")

</div>

For future readers, please note that the issue discussed here is not a critical problem; it’s primarily an annoyance. However, if you’re interested in resolving it, here’s an explanation.

The issue arises when you enable HTTPS locally; DevKinsta utilizes a self-signed certificate. CURL, which verifies certificates, uses a bundle that contains public keys from recognized certificate authorities. Naturally, a self-signed certificate isn’t recognized by this bundle. Consequently, when a plugin or your code uses CURL to fetch data from your own page (e.g., `https://your-site.local`), you will encounter the SSL error 60.

In my efforts to resolve this, I discovered that you need to add your own certificate to the certificate bundle used by CURL. This adjustment is made inside the `devkinsta_fpm` container. Unfortunately, this didn’t solve my issue entirely. It turns out that `wp_remote_get()`, a PHP function within WordPress, uses its own set of certificates. To address the problem, you must add your certificate to the bundle located at `wp-includes/certificates/ca-bundle.crt`. Simply open this file in a text editor to make the addition.

**Disclaimer:** This is not inherently a problem; it’s more about alleviating an annoyance. I’m not aware of all potential consequences of these changes. For instance, they might be overwritten during a WordPress update, or they might complicate collaboration in a team setting. I just wanted to shed some light on this. Below is a PHP script you can use to test for these errors by adding the script to your plugin folder:

```php
/**
 * Plugin Name: CURL and WP Remote Get Test Plugin
 * Description: Tests CURL requests and WordPress HTTP API requests from the admin area.
 * Version: 1.0
 * Author: ChatGPT4
 */

function curl_and_wp_remote_test_menu() {
    add_menu_page('CURL and WP Remote Test', 'CURL and WP Remote Test', 'manage_options', 'curl_wp_remote_test_plugin', 'curl_wp_remote_test_admin_page');
}

add_action('admin_menu', 'curl_and_wp_remote_test_menu');

function curl_wp_remote_test_admin_page() {
    echo '<h2>CURL and WP Remote Get Test Output</h2>';

    // CURL Test
    $curl_url = 'https://your-site.local'; // Adjust the URL to match your needs
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $curl_url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1); // This ensures SSL verification is enabled
    $output = curl_exec($ch);
    $error = curl_error($ch);
    curl_close($ch);

    if (!empty($error)) {
        echo "<p>CURL Error: " . esc_html($error) . "</p>";
    } else {
        echo "<p>Success: CURL fetched the CSS file successfully.</p>";
    }

    // WordPress HTTP API Test
    $wp_remote_url = 'https://your-site.local'; // Change this to a URL with your self-signed certificate
    $response = wp_remote_get($wp_remote_url, array('sslverify' => true));

    if (is_wp_error($response)) {
        echo '<div class="notice notice-error"><p>WP Remote Get Test Failed: ' . esc_html($response->get_error_message()) . '</p></div>';
    } else {
        echo '<div class="notice notice-success"><p>WP Remote Get Test Succeeded: Response successfully received.</p></div>';
    }
}

```

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex020/uploads/kinsta/original/2X/8/80f8c4e56fecc02327a0964e6bf63a716483529f.png) [@system](https://community.kinsta.com/u/system)
#### Post date: [June 27, 2024, 2:29am UTC](https://community.kinsta.com/t/devkinsta-localhost-curl-error-60-ssl-certificate-problem/3615/6 "2024-06-27T02:29:36Z")

</div>

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
