ForceChallenges
ProblemsDailyNotesInterview
Sign in

Practice

All problemsSOQL practiceApex trigger challengesDaily challengeOpportunityTrigger.oldMapBefore UpdateBulkificationContactValidationGROUP BYSemi-JoinAccountBefore Insert

Interview questions

All questionsAdminAdministrationApexApex TriggerAsync ApexDevelopmentField ServiceField ServiceIntegrationLwc

By company

DeloitteSalesforceAccentureInfosysPwCCognizant

Learn

Study notes

ForceChallenges

AboutContact usPrivacy PolicyTerms of ServiceFor AI assistants (llms.txt)
© 2026 ForceChallenges · Salesforce SOQL & Apex trigger practice
Integration questions25 of 100
IntegrationMedium 2 min read

How does Mutual TLS (mTLS) enhance security by enforcing two-way certificate validation for enterprise integrations?

Answer

Basics: In ordinary TLS, only the server proves its identity. With mutual TLS (also called two-way SSL or mutual authentication), the client also proves it holds a certificate that the server trusts. This blocks callers that have stolen credentials but not the private key.

How it works:

  • Inbound to Salesforce: Salesforce supports mutual authentication for API clients, which must be enabled by Salesforce Support. Clients connect on the mutual-auth endpoint (port 8443), and the org is given the trusted CA or client certificate. Users or integration profiles need the "Enforce SSL/TLS Mutual Authentication" permission. Verify the current setup path in Setup and docs.
  • Outbound from Salesforce: upload or generate a certificate in Certificate and Key Management, then reference it in Apex with req.setClientCertificateName('MyCert'), or in a Named Credential or External Credential configured with a client certificate.
  • The external server validates Salesforce's client certificate during the handshake, before any HTTP request is processed.

Advanced / deep dive: mTLS complements, but does not replace, OAuth. A common high-security design uses mTLS for transport trust plus OAuth JWT for identity and authorization. Certificates expire, so you need a rotation plan, because an expired certificate stops the integration. Private connectivity options, such as Private Connect, add network-level protection. Where an API gateway terminates TLS, make sure the gateway enforces the client certificate, since a gateway that accepts any certificate gives no security. Salesforce signs outbound calls with the org's certificate, so share only the public certificate with partners.

Code / config example:

apex
HttpRequest req = new HttpRequest();
req.setEndpoint('callout:Partner_API/orders');   // Named Credential
req.setMethod('POST');
req.setClientCertificateName('Partner_mTLS_Cert'); // cert from Certificate and Key Management
req.setHeader('Content-Type', 'application/json');
req.setBody(JSON.serialize(payload));
HttpResponse res = new Http().send(req);

Hidden gotchas & must-remember points:

  • Inbound mutual authentication is not on by default and needs enablement by Salesforce Support.
  • Expired or rotated certificates are a leading cause of integration outages.
  • mTLS authenticates the client system, not the user, so you still need OAuth or a session.
  • Self-signed certificates can be used, but the other side must explicitly trust them.
  • Certificate names in Apex must match exactly, and sandbox refresh does not always carry certificates over.
  • It does not replace IP restrictions or permission controls.

Best practice: Combine mTLS with OAuth, automate certificate rotation, and monitor expiry dates.

IntegrationMutual TLSAdvanced Security
Practice SOQL & Apex
PreviousWhat architectural role do API Gateways play in managing enterprise traffic entering Salesforce endpoints?Next How do event-driven data replication patterns streamline data warehousing and analytical data lake synchronization?

More Integration questions

  • How do PushTopics combine SOQL query criteria with real-time streaming notifications in Salesforce?
  • How do webhook security mechanisms verify the authenticity of incoming HTTP notifications from external systems?
  • How do federated identity and SAML single sign-on streamline authentication across enterprise integration landscapes?
  • How do CORS settings permit authorized web applications to perform cross-origin REST requests against Salesforce?
  • How do rate limiting and throttling mechanisms protect Salesforce endpoints from excessive traffic spikes?