Curl Error: Peer’s Certificate Issuer Is Not Recognized
60 is cURL’s exit code for this certificate issuer error: the HTTPS client cannot build a trusted certificate chain from the server’s certificate to a certificate authority (CA) it trusts. The problem may be a missing intermediate certificate on a public website, an outdated or misconfigured local CA bundle, or an internal service whose private CA has not been installed in the calling environment. Start by identifying the certificate cURL actually receives, then fix the server chain or the client trust store without disabling verification.
Use this table to match the symptom to the safest first fix.
| Symptom | Likely Cause | Safe First Fix |
|---|---|---|
| A public HTTPS URL fails from several machines | The server is not sending its intermediate certificate chain | Inspect the presented chain and configure the server to serve its full chain |
| The URL works on one host but fails in a container, VM, or CI job | That runtime has an old, missing, or overridden CA bundle | Check the CA file cURL is using and update or correct that runtime’s trust store |
| An internal hostname or local service fails | The client does not trust the organization’s private root CA | Install or explicitly configure the private CA certificate |
| A browser works but a PHP application fails | PHP-FPM may use a different configuration or CA file than the browser or shell | Configure the CA bundle in the PHP-FPM configuration actually serving the app |
| The error happens only on a company network | A TLS-inspecting proxy may be presenting its own certificate | Confirm the presented issuer and use the organization-approved proxy CA |
| The message says no certificate was provided | This is not an issuer-trust failure | Check the URL, TLS endpoint, reverse proxy, and port routing |
What the cURL Peer Issuer Error Means
A TLS server sends a certificate identifying the hostname it serves. That certificate is normally issued by an intermediate CA, which is in turn linked to a trusted root CA already installed on the client.
The “peer” is the remote server cURL connected to. Its “issuer” is the CA that signed the server certificate. If cURL cannot find a trusted path through the certificates it received and the CA certificates installed locally, it rejects the connection before sending the HTTP request.
This error does not automatically mean the remote site is malicious. It means the client cannot verify the identity presented during this connection. The common causes are:
- The web server sends only its leaf certificate and omits an intermediate certificate.
- cURL is pointed at an incorrect, empty, unreadable, or outdated CA bundle.
- The application runs in a container or separate runtime with different CA certificates from the host.
- The endpoint uses a self-signed certificate or a certificate issued by a private company CA.
- A proxy, firewall, or security product intercepts HTTPS and presents a certificate issued by its own CA.
A public HTTPS endpoint with a broken certificate chain and a local service using a self-signed root can produce the same issuer error, so inspect the actual issuer before choosing a server-chain or trust-store repair.
How to Fix the cURL Certificate Issuer Error
Step 1: Reproduce the Request From the Same Runtime
Run the test from the environment that fails. If the application runs in a Docker container, Kubernetes pod, CI runner, or PHP-FPM worker, testing only from your laptop shell can give a misleading result because each environment can have a different CA bundle.
Replace the example hostname with the exact hostname in the failing URL:
curl -vI https://api.example.com/
The verbose output usually includes the CA file or CA directory cURL tried to use and shows where certificate verification failed.
If the failing application follows redirects, first test the original URL without automatic redirects. A redirect may send the request to a different hostname with a separate certificate problem.
I reproduce one problem at a time in a clean container or virtual environment, because it separates an application’s CA settings from the host machine’s trust store.
Step 2: Inspect the Certificate Chain the Server Sends
Use OpenSSL to see the peer certificate, its issuer, and the certificate chain sent by the endpoint:
openssl s_client -connect api.example.com:443 -servername api.example.com -showcerts -verify_return_error </dev/null
Look for these parts of the output:
subject=identifies the server certificate.issuer=identifies the CA that issued it.Certificate chainshows certificates the server sent.Verify return codeshows whether OpenSSL could validate the chain with the local trust store.
The -servername option matters for shared hosting and reverse proxies. It sends Server Name Indication (SNI), allowing the server to select the certificate for the hostname you requested rather than a default certificate.
If the issuer is a public CA but the chain is incomplete, fix the server. If the issuer is an internal organization, a development CA, or a self-signed certificate, configure trust in the client environment instead.
Step 3: Apply the Matching Certificate Repair
Choose the repair that matches the issuer you found.
For a public certificate with a missing intermediate
- Update the web server or load balancer configuration so it serves the leaf certificate plus its required intermediate certificates.
- Do not add the public root CA to the server’s served chain. Clients already carry trusted roots; the server’s job is to send the certificates between its leaf certificate and that root.
- If your certificate provider supplies both
cert.pemandfullchain.pem, the TLS server commonly needs the full-chain file. Serving only the leaf certificate can work in some browsers yet fail in cURL and other stricter runtimes. - Reload or restart the TLS service, then rerun the cURL command from the affected runtime and retry the application request.
For a correct public server certificate that fails only on one machine or container
- Check cURL’s verbose output to find the CA file or directory it is using.
- Update the operating system’s CA-certificate package in that runtime. For example, on Debian- or Ubuntu-based systems:
sudo apt update
sudo apt install --reinstall ca-certificates
On Fedora- or RHEL-family systems:
sudo dnf reinstall ca-certificates
- Rebuild and redeploy a container image after updating its CA package; changing the host’s trust store does not change an already-built image.
- Restart the application process if it loads CA certificates at startup, then repeat the exact HTTPS request.
For a private CA or self-signed root
- Obtain the organization’s root CA certificate from an authorized internal source. Do not download a CA certificate from an unverified web page or accept one sent by an unknown endpoint.
- Install that root CA into the operating system trust store used by the application, or configure the application’s HTTP client with the root CA file.
- Confirm that the server certificate’s hostname matches the hostname in the URL and that any private intermediate certificates are available in the server chain.
- Test the private CA explicitly with cURL:
curl --cacert /path/to/private-root-ca.pem -vI https://service.example.internal/
- After curl –cacert validates the private CA, configure the real application to use that same trusted root, restart or redeploy it, and repeat the application request.
A self-signed root certificate can be a valid trust anchor for an internal PKI. A self-signed leaf certificate is different: it is the server certificate itself and is usually less manageable than using a private root CA to issue separate server certificates.
Step 4: Keep TLS Verification Enabled
Do not treat --insecure or -k as a fix. Those options tell cURL to skip certificate validation, which allows a malicious or intercepted server to impersonate the intended endpoint.
An insecure test only distinguishes certificate-verification failures from other connection failures; inspect the presented chain and CA configuration to identify the defect.
Public Certificate Chain Problems
A public certificate can be valid while the server still sends an incomplete chain. The server sends its own certificate and the intermediate certificates needed to reach a trusted root. The client supplies the trusted root from its local CA store.
This is why the same public URL can appear to work in one browser but fail in cURL:
- A browser may already have cached an intermediate from another visit.
- One machine may have a newer CA bundle than another.
- A browser, PHP runtime, container image, and command-line cURL may not use the same trust store.
- The server may return a different certificate depending on hostname, SNI, load balancer, or network route.
A common deployment mistake is configuring a web server with a certificate-only file rather than the provider’s full-chain file. Correcting the server chain is better than asking every client to install a public intermediate manually.
If OpenSSL shows a public issuer but one of the expected intermediate certificates is absent from Certificate chain, fix the server or load balancer configuration. If the complete chain is present but only one old system fails, update that system’s CA certificates instead.
Private Services, Proxies, and macOS
Internal roots, HTTPS-inspecting proxies, and separate macOS cURL installations require trust configuration in the affected runtime.
Internal Services and Self-Signed Roots
Private service names such as service.example.internal often use certificates from an internal CA. The service can be correctly configured while cURL still fails because the caller has never been given the internal root certificate.
One Proxmox user reports that a webhook connection to a local service using a self-signed root certificate failed with an unknown-issuer certificate error.
For internal services, distribute the private root CA through your organization’s normal device, container-image, and configuration-management process. Applications should trust the root CA, not blindly trust every individual server certificate. When a service is accessed from containers, include the trusted root in the image or mount it securely at runtime.
HTTPS-Inspecting Proxies
Corporate networks sometimes decrypt and re-encrypt outbound HTTPS traffic. In that setup, the client may receive a certificate issued by the organization’s proxy CA rather than the public website’s CA.
Inspect the issuer= line from the OpenSSL command. If it names a company proxy or security product, contact the network or security team for the approved CA certificate and installation method. Do not install a proxy CA simply because an unexpected network connection offered it.
macOS cURL Errors
On macOS, the built-in cURL and a separately installed cURL may use different TLS libraries and trust sources. Check which TLS backend your command-line cURL uses:
curl -V
If the issuer error occurs only in one development tool, language runtime, or separately installed cURL, configure trust for that specific runtime rather than assuming the macOS system trust settings are being used. For an organization-managed private CA, install it through the organization-approved system or device-management process.
Configure the CA Bundle for PHP-FPM
PHP command-line processes and PHP-FPM can load different php.ini files. A successful shell test with php does not prove that the web application’s PHP-FPM workers have the same CA configuration.
The common Debian- and Ubuntu-style PHP-FPM configuration pattern is /etc/php/<version>/fpm/php.ini. For a PHP 7.0-FPM installation, the file is /etc/php/7.0/fpm/php.ini. Confirm the exact file through PHP-FPM’s phpinfo() output or the configuration for the installed PHP-FPM version; do not assume the CLI php.ini is the active FPM file.
Add or correct these settings, using an absolute path to a readable CA bundle:
curl.cainfo = "/absolute/path/to/ca-bundle.pem"
openssl.cafile = "/absolute/path/to/ca-bundle.pem"
curl.cainfo controls PHP cURL requests. openssl.cafile helps PHP components that use OpenSSL streams rather than the cURL extension.
Be careful when setting a custom CA file: it replaces the default source for that process. A file containing only an internal root can make public HTTPS sites fail. Use the managed system CA bundle, or a properly maintained bundle containing both the normal public roots and the required private root.
After changing PHP-FPM configuration, restart the FPM service. In the reported PHP 7.0 setup, the service name is php7.0-fpm:
sudo systemctl restart php7.0-fpm
Then test through the web application or a temporary PHP endpoint served by FPM, not only through the PHP CLI. Confirm the PHP-FPM worker can read the CA file and that its configured bundle contains the issuer needed for the target service.
Confirm the Fix and Prevent a Return
A successful repair has two parts: cURL validates the certificate from the affected runtime, and the real application completes its request without disabling verification.
Use this short checklist:
- The test URL uses the exact hostname the application calls.
- The server sends its leaf certificate and required intermediate certificates.
- The certificate’s hostname matches the URL hostname.
- The application runtime trusts the required public or private root CA.
- Containers and CI images include current CA certificates.
- PHP-FPM uses the intended
php.iniand CA file. - No application code, environment variable, or deployment setting disables TLS verification.
- Certificate renewals preserve the server’s full certificate chain.
For public endpoints, add an HTTPS check from a clean runtime after certificate renewals or load-balancer changes. For internal endpoints, include private CA distribution in the same deployment process that creates new machines, containers, and application environments.
Frequently Asked Questions
What does “peer’s certificate issuer” mean?
The peer’s certificate issuer is the certificate authority that signed the certificate presented by the remote HTTPS server. cURL verifies that issuer through a chain of certificates ending at a trusted root CA. The error occurs when that chain is missing, invalid, or unknown to the client.
What does cURL exit code 77 mean?
Exit code 77 means cURL could not read the CA certificate file or directory it was told to use. Check that the configured CA path exists, is readable by the application user, and contains valid PEM certificates rather than an HTML download, empty file, or incorrect path. This is a local CA-file configuration problem, not proof that the remote server certificate is bad.
Why does the error appear in PHP but not in my terminal?
PHP-FPM can use a different php.ini, user account, filesystem view, and CA bundle from command-line PHP or command-line cURL. In a PHP 7.0-FPM setup, check /etc/php/7.0/fpm/php.ini, set curl.cainfo to the correct CA bundle, restart php7.0-fpm, and test through the FPM-served application.
Why does cURL say no SSL certificate was provided by the peer?
“No SSL certificate was provided by the peer” means the TLS handshake did not receive a server certificate, so it is not an issuer-recognition error. The endpoint may be serving plain HTTP, using the wrong listener, routing through a misconfigured proxy, or terminating TLS somewhere other than expected. Verify the URL scheme, hostname, reverse-proxy routing, and service that receives the connection.
Does “1g” identify a cURL certificate error?
For this issuer error, preserve the full error message rather than interpreting “1g” alone. Preserve the full error message, run curl -V to identify the cURL build and TLS backend, and run a verbose request against the exact failing hostname to determine whether the issue is a certificate chain, CA-file, proxy, or endpoint-routing problem.
