Certificate Authority Works in Linux but Fails in MacOS

Abstract: Fixes macOS certificate trust failures for local CAs by configuring Keychain Access to always trust the certificate.

Created: 2026-08-17 by
Certificate Authority trust issues on macOS often stem from differences in how the operating system manages its keychain compared to Linux. While Linux typically relies on a single system-wide store like /etc/ssl/certs, macOS uses the Keychain Access application with distinct Trust settings for each certificate. This article explains why your local development CA might work in browsers or tools on Linux but fail on macOS, and provides the exact steps to fix it by manually adjusting trust policies.

Understanding the Root Cause

The primary reason for this discrepancy lies in the architecture of certificate validation. On most Linux distributions, adding a certificate to the system trust store is a matter of copying the file to a specific directory and running an update command. The system then trusts that certificate globally for all applications. macOS, however, isolates certificates within the user’s Keychain. Even if you import a certificate into the "System" or "Login" keychain, it does not automatically inherit full trust privileges. By default, newly imported certificates in macOS are set to "System Default." This setting often results in untrusted errors when used for self-signed domains or internal Certificate Authorities. You must explicitly change the trust level to "Always Trust" for the certificate to be recognized by Safari, Chrome, and other macOS-native applications. Without this manual override, the OS treats the certificate as unverified, blocking secure connections even if the underlying cryptographic signature is valid.

Importing the Certificate Correctly

To resolve the issue, you first need to ensure the certificate is properly placed in the correct keychain. Open the Keychain Access application, which can be found via Spotlight search. Drag your .crt or .pem file into the window. It is crucial to drop the file into the System keychain rather than the Login keychain if you want the trust setting to apply to all users on the machine. If you are working on a personal machine, the Login keychain is acceptable, but you must ensure you are editing the right entry. Once the certificate appears in the list, double-click it to open its properties. You will see several sections, including Basic Constraints, Key Usage, and Trust. Expand the Trust section. Here, you will find options for how the certificate should be handled during SSL connections. By default, this may be set to "Use System Defaults," which causes the failure you are experiencing. Change the option for Secure Sockets Layer (SSL) to Always Trust. You may also need to adjust the HTTPS and HTTP settings depending on your application requirements, though SSL usually covers HTTPS traffic. After making these changes, close the window. macOS will prompt you to authenticate using your password or Touch ID to confirm the change. Once authenticated, the certificate is now trusted for secure connections. You may need to restart your browser or clear its DNS cache for the changes to take effect immediately.

Verifying Trust Settings

It is important to verify that the trust policy was applied correctly. Return to the certificate details in Keychain Access and look at the Trust section again. Ensure that the dropdowns for SSL, HTTPS, and HTTP all reflect your new selection. If they still show "Use System Defaults," the change did not save, and you should repeat the process. Additionally, check the icon next to the certificate in the main list. A trusted certificate usually displays a small lock icon or no warning symbol. An untrusted one might display a red cross or a question mark. If the certificate shows a warning despite being set to Always Trust, there may be a conflict with existing certificates. Check if you have multiple entries for the same Common Name (CN). Duplicate certificates can cause confusion in the validation chain. Remove any duplicate entries, keeping only the one with the correct trust settings. Clearing the browser cache is also recommended, as browsers often cache certificate revocation lists and trust states locally.

Troubleshooting Persistent Errors

If you have adjusted the trust settings and the error persists, consider checking the certificate chain. A root certificate alone is often insufficient; intermediate certificates may be required to establish a complete chain of trust. Ensure that all necessary intermediate CAs are also imported into the Keychain and set to Always Trust. You can view the chain by clicking on the certificate in Keychain Access and looking at the related certificates section. Another common issue arises from time synchronization. macOS relies heavily on accurate system time for certificate validation. If your system clock is significantly off, certificates may appear invalid because their validity period seems to be in the future or past. Check your date and time settings to ensure they are synchronized with internet time servers. Finally, some enterprise environments use Managed Trust Policies via Mobile Device Management (MDM) profiles. These profiles can override user-level trust settings. If you are on a managed device, contact your IT administrator to ensure the CA is approved at the system level.

Frequently Asked Questions

Why does my browser still show a warning after changing trust settings?

Browsers like Chrome and Firefox maintain their own certificate stores separate from macOS Keychain Access. After updating the trust in Keychain, you must restart the browser completely. In some cases, you may need to go into the browser's security settings and remove the previous exception for the site before reloading.

Can I automate the trust setting process via command line?

Yes, you can use the security command-line tool to modify trust policies. For example, you can use security add-trusted-cert to add a certificate and then use security set-key-partition-list to adjust partition flags. However, manually using Keychain Access is generally safer and more transparent for individual developers.

What is the difference between System and Login keychains?

The Login keychain is tied to your specific user account and unlocks when you log in. The System keychain affects all users on the machine and requires administrative privileges to modify. For development environments shared across users, placing the CA in the System keychain ensures consistent behavior.

How do I remove a trusted certificate if I made a mistake?

Open Keychain Access, locate the certificate, and delete it by pressing the Delete key or selecting File > Delete. You will be prompted to enter your password to confirm the removal. After deletion, restart your browser to ensure the trust state is cleared.

Does this issue affect curl or wget commands?

Tools like curl and wget on macOS often rely on the system keychain for SSL verification. If you have added the CA to the System keychain and set it to Always Trust, these tools should recognize it. If they still fail, you may need to specify the certificate path explicitly using the --cacert flag.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More