mirror of
https://github.com/FiloSottile/mkcert.git
synced 2026-04-25 13:36:02 +03:00
[GH-ISSUE #165] WordPress health check error: curl: (60) SSL certificate problem: unable to get local issuer certificate #105
Labels
No labels
TLS stack issue
Windows
bug
duplicate
duplicate
enhancement
help wanted
help wanted
pull-request
question
question
root store
waiting for info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/mkcert#105
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @emmtre on GitHub (May 26, 2019).
Original GitHub issue: https://github.com/FiloSottile/mkcert/issues/165
It this a known issue with macOS Mojave (10.14.5)? I have problems with site health check in WordPress 5.2.1 and REST API and loopback requests.
@emmtre commented on GitHub (May 26, 2019):
@Cobs commented on GitHub (May 31, 2019):
I got the same message with Debian.
Fixed it by manualy adding the mkcert's CA Certificate into the local CA cert store and set the extention from .pem to .crt
@emmtre commented on GitHub (May 31, 2019):
The CA Certificate is added to the macOS system store automatically. When using
/usr/bin/curleverything is working as expected. But WordPress is using it's own version ofcurlso the installed mkcert's CA Certificate is not found. I have also tried to setcurl.cainfowithout success. Any other ideas?curl.cainfo=/Users/Username/Library/Application\ Support/mkcert/rootCA.pem@healdev commented on GitHub (May 31, 2019):
Same problem here...
Running WordPress 5.2.1 on local OS X Mojave
curl command works with no issue in terminal but WordPress HealthCheck throws a curl error 60... for REST API and Loopback requests.
Anybody solved that?
ps: @emmtre not sure but shouldn't the path be wrapped in double quotes for the curl.cainfo setting?
@healdev commented on GitHub (May 31, 2019):
The only hack I could find on my local dev environment is to manually edit /wp-includes/certificates/ca-bundle.crt and append the content of /Users/Username/Library/Application\ Support/mkcert/rootCA.pem to end of file
That solved the problem, I just need to find a long-term solution...maybe a must-use plugin that would check and edit the file automatically... or I'll try to find a hook
@healdev commented on GitHub (May 31, 2019):
Ok so there is a filter to deal with this issue.
Since I have this issue only on my local dev env, I created a must-use plugin that checks if the environment is local and looks for certificate in the desired file.
@FiloSottile commented on GitHub (Jun 1, 2019):
Yeah, WordPress is configuring curl to use a hardcoded CA list, so there's not much mkcert can do.
Closing this as it's not a mkcert issue, but thanks for providing a workaround, and maybe consider opening an issue with WordPress to use the system store, I don't think there's any good reason not to.
@simongcc commented on GitHub (Feb 25, 2020):
@healdev
I am meeting the same situation. And found that there is a filter for updating thepath.I have created a certificate for local use and point to that by calling the filter and put it insidefunctions.php.add_filter( 'http_request_args', 'modify_ca_cert_location', 10, 2 );function modify_ca_cert_location( $r ) {
$r['sslcertificates'] = WP_CONTENT_DIR.'/themes/wp-theme-name/ssl/ca-bundle.crt';
return $r;
}
@simongcc commented on GitHub (Mar 1, 2020):
@healdev
Ops, I think I have overlooked and missed your solutions by just scanning through without reading in depth.
Sorry about that.
@Kevinlearynet commented on GitHub (Apr 19, 2020):
This isn't an issue with
mkcert, like @FiloSottile mentioned, it's ultimately something caused by the way WordPress handles cURL requests. Here's the specific line causing it:github.com/WordPress/WordPress@856e1a27b8/wp-includes/class-http.php (L209)I've fixed this myself in a Homebrew installed PHP 7.4 localhost using this function:
This will filter all HTTP class instances, replacing the locally used cURL certificate authority at
/wp-includes/certificates/ca-bundle.crtwith the certificate authority currently used by PHP for any request to a *.test TLD. I use .test domains locally, but if you use other URL's be sure to adjust this part.@netnaps commented on GitHub (Jun 24, 2020):
i had the same issue it was just because of another plugin named really simple ssl , deactivated the same and it worked.
@petertwise commented on GitHub (Sep 23, 2020):
Thanks for the great research on this issue everyone. I made some of the solutions presented here into a dropin plugin:
https://github.com/squarecandy/force-localhost-ca
@nylen commented on GitHub (Oct 16, 2020):
For what it's worth, there are very good reasons not to use the system cert store. One of them is that WordPress and ClassicPress run on a very wide variety of servers, which includes servers that unfortunately have not been updated in a long time. This would cause many legitimate requests to fail.
@Werverton commented on GitHub (Dec 16, 2021):
In which local?
@Cobs commented on GitHub (Dec 19, 2021):
I'm not sure i understand the question.
As told in the update-ca-certificate program's manual, I just copied the mkcert certificate in /usr/local/share/ca-certificates as a .crt file then ran update-ca-certificate
@Werverton commented on GitHub (Dec 20, 2021):
In my case, I solved the problem inserting the SSLCACertificate /Path/to/domain.ca-bundle in virtual host .conf . The cURL needs the Chain of certificate.