<!--
{
  "documentType" : "article",
  "framework" : "Security",
  "identifier" : "/documentation/Security/secure-transport-result-codes",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Secure Transport Result Codes"
}
-->

# Secure Transport Result Codes

Recognize result codes specific to the secure transport API.

## Discussion

Use the [`SecCopyErrorMessageString(_:_:)`](/documentation/Security/SecCopyErrorMessageString(_:_:)) function to obtain a human readable string corresponding to these status codes.

The functions of the [Secure Transport](/documentation/Security/secure-transport) API may also return the general codes listed in [Security Framework Result Codes](/documentation/Security/security-framework-result-codes).

Errors in the range of –9819 through –9840 are fatal errors that are detected by the peer.

## Topics

### App Transport Security result codes

[`var errSSLATSViolation: OSStatus`](/documentation/Security/errSSLATSViolation)

An App Transport Security violation occurred.

[`var errSSLATSMinimumVersionViolation: OSStatus`](/documentation/Security/errSSLATSMinimumVersionViolation)

The minimum protocol version isn’t App Transport Security compliant.

[`var errSSLATSCiphersuiteViolation: OSStatus`](/documentation/Security/errSSLATSCiphersuiteViolation)

The selected ciphersuite isn’t App Transport Security compliant.

[`var errSSLATSMinimumKeySizeViolation: OSStatus`](/documentation/Security/errSSLATSMinimumKeySizeViolation)

The peer key size isn’t App Transport Security compliant.

[`var errSSLATSLeafCertificateHashAlgorithmViolation: OSStatus`](/documentation/Security/errSSLATSLeafCertificateHashAlgorithmViolation)

The peer leaf certificate hash algorithm isn’t App Transport Security compliant.

[`var errSSLATSCertificateHashAlgorithmViolation: OSStatus`](/documentation/Security/errSSLATSCertificateHashAlgorithmViolation)

The peer certificate hash algorithm isn’t App Transport Security compliant.

[`var errSSLATSCertificateTrustViolation: OSStatus`](/documentation/Security/errSSLATSCertificateTrustViolation)

The peer certificate wasn’t issued by a trusted peer.

### Certificate issue result codes

[`var errSSLBadCert: OSStatus`](/documentation/Security/errSSLBadCert)

Bad certificate format.

[`var errSSLBadCertificateStatusResponse: OSStatus`](/documentation/Security/errSSLBadCertificateStatusResponse)

Bad OCSP response.

[`var errSSLCertExpired: OSStatus`](/documentation/Security/errSSLCertExpired)

The certificate chain had an expired certificate.

[`var errSSLCertNotYetValid: OSStatus`](/documentation/Security/errSSLCertNotYetValid)

The certificate chain had a certificatethat is not yet valid.

[`var errSSLCertificateRequired: OSStatus`](/documentation/Security/errSSLCertificateRequired)

Certificate required.

[`var errSSLClientCertRequested: OSStatus`](/documentation/Security/errSSLClientCertRequested)

The server has requested a client certificate.

[`var errSSLHostNameMismatch: OSStatus`](/documentation/Security/errSSLHostNameMismatch)

The host name you connected with does not match any of the host names allowed by the certificate.

[`var errSSLNoRootCert: OSStatus`](/documentation/Security/errSSLNoRootCert)

No root certificate for the certificate chain.

[`var errSSLPeerBadCert: OSStatus`](/documentation/Security/errSSLPeerBadCert)

A bad certificate was encountered.

[`var errSSLPeerCertExpired: OSStatus`](/documentation/Security/errSSLPeerCertExpired)

The certificate expired.

[`var errSSLPeerCertRevoked: OSStatus`](/documentation/Security/errSSLPeerCertRevoked)

The certificate was revoked.

[`var errSSLPeerCertUnknown: OSStatus`](/documentation/Security/errSSLPeerCertUnknown)

The certificate is unknown.

[`var errSSLPeerUnsupportedCert: OSStatus`](/documentation/Security/errSSLPeerUnsupportedCert)

An unsupported certificate format was encountered.

[`var errSSLUnknownRootCert: OSStatus`](/documentation/Security/errSSLUnknownRootCert)

Certificate chain is valid, but root is nottrusted.

[`var errSSLXCertChainInvalid: OSStatus`](/documentation/Security/errSSLXCertChainInvalid)

Invalid certificate chain.

[`var errSSLPeerUnknownCA: OSStatus`](/documentation/Security/errSSLPeerUnknownCA)

An unknown certificate authority was encountered.

### Connection status result codes

[`var errSSLClientHelloReceived: OSStatus`](/documentation/Security/errSSLClientHelloReceived)

A non-fatal result for providing a server name indication.

[`var errSSLClosedAbort: OSStatus`](/documentation/Security/errSSLClosedAbort)

The connection closed due to an error.

[`var errSSLClosedGraceful: OSStatus`](/documentation/Security/errSSLClosedGraceful)

The connection closed gracefully.

[`var errSSLClosedNoNotify: OSStatus`](/documentation/Security/errSSLClosedNoNotify)

The server closed the session with no notification.

[`var errSSLConnectionRefused: OSStatus`](/documentation/Security/errSSLConnectionRefused)

The peer dropped the connection before responding.

[`var errSSLPeerAuthCompleted: OSStatus`](/documentation/Security/errSSLPeerAuthCompleted)

A non-fatal result indicating the peer certificate is valid, or was ignored if verification is disabled.

[`var errSSLWouldBlock: OSStatus`](/documentation/Security/errSSLWouldBlock)

Function is blocked; waiting for I/O. This is not fatal.

### Cryptography result codes

[`var errSSLCrypto: OSStatus`](/documentation/Security/errSSLCrypto)

An underlying cryptographic error was encountered.

[`var errSSLDecryptionFail: OSStatus`](/documentation/Security/errSSLDecryptionFail)

Decryption failed.

[`var errSSLPeerDecryptError: OSStatus`](/documentation/Security/errSSLPeerDecryptError)

A decryption error occurred.

[`var errSSLPeerDecryptionFail: OSStatus`](/documentation/Security/errSSLPeerDecryptionFail)

Decryption failed.

[`var errSSLWeakPeerEphemeralDHKey: OSStatus`](/documentation/Security/errSSLWeakPeerEphemeralDHKey)

Indicates a weak ephemeral dh key.

### Other result codes

[`var errSSLBadCipherSuite: OSStatus`](/documentation/Security/errSSLBadCipherSuite)

A bad SSL cipher suite was encountered.

[`var errSSLBadConfiguration: OSStatus`](/documentation/Security/errSSLBadConfiguration)

A configuration error occurred.

[`var errSSLBadRecordMac: OSStatus`](/documentation/Security/errSSLBadRecordMac)

A record with a bad message authentication code (MAC) was encountered.

[`var errSSLBufferOverflow: OSStatus`](/documentation/Security/errSSLBufferOverflow)

An insufficient buffer was provided.

[`var errSSLConfigurationFailed: OSStatus`](/documentation/Security/errSSLConfigurationFailed)

TLS configuration failed.

[`var errSSLDecodeError: OSStatus`](/documentation/Security/errSSLDecodeError)

Decode failed.

[`var errSSLDecompressFail: OSStatus`](/documentation/Security/errSSLDecompressFail)

Decompression failed.

[`var errSSLFatalAlert: OSStatus`](/documentation/Security/errSSLFatalAlert)

A fatal alert was encountered.

[`var errSSLHandshakeFail: OSStatus`](/documentation/Security/errSSLHandshakeFail)

Handshake failed.

[`var errSSLIllegalParam: OSStatus`](/documentation/Security/errSSLIllegalParam)

An illegal parameter was encountered.

[`var errSSLInappropriateFallback: OSStatus`](/documentation/Security/errSSLInappropriateFallback)

Inappropriate fallback.

[`var errSSLInternal: OSStatus`](/documentation/Security/errSSLInternal)

Internal error.

[`var errSSLMissingExtension: OSStatus`](/documentation/Security/errSSLMissingExtension)

Missing extension.

[`var errSSLModuleAttach: OSStatus`](/documentation/Security/errSSLModuleAttach)

Module attach failure.

[`var errSSLNegotiation: OSStatus`](/documentation/Security/errSSLNegotiation)

The cipher suite negotiation failed.

[`var errSSLNetworkTimeout: OSStatus`](/documentation/Security/errSSLNetworkTimeout)

Network timeout triggered.

[`var errSSLPeerAccessDenied: OSStatus`](/documentation/Security/errSSLPeerAccessDenied)

Access was denied.

[`var errSSLPeerBadRecordMac: OSStatus`](/documentation/Security/errSSLPeerBadRecordMac)

A record with a bad message authentication code (MAC) was encountered.

[`var errSSLPeerDecodeError: OSStatus`](/documentation/Security/errSSLPeerDecodeError)

A decoding error occurred.

[`var errSSLPeerDecompressFail: OSStatus`](/documentation/Security/errSSLPeerDecompressFail)

Decompression failed.

[`var errSSLPeerExportRestriction: OSStatus`](/documentation/Security/errSSLPeerExportRestriction)

An export restriction occurred.

[`var errSSLPeerHandshakeFail: OSStatus`](/documentation/Security/errSSLPeerHandshakeFail)

The handshake failed.

[`var errSSLPeerInsufficientSecurity: OSStatus`](/documentation/Security/errSSLPeerInsufficientSecurity)

There is insufficient security for this operation.

[`var errSSLPeerInternalError: OSStatus`](/documentation/Security/errSSLPeerInternalError)

An internal error occurred.

[`var errSSLPeerNoRenegotiation: OSStatus`](/documentation/Security/errSSLPeerNoRenegotiation)

No renegotiation is allowed.

[`var errSSLPeerProtocolVersion: OSStatus`](/documentation/Security/errSSLPeerProtocolVersion)

A bad protocol version was encountered.

[`var errSSLPeerRecordOverflow: OSStatus`](/documentation/Security/errSSLPeerRecordOverflow)

A record overflow occurred.

[`var errSSLPeerUnexpectedMsg: OSStatus`](/documentation/Security/errSSLPeerUnexpectedMsg)

An unexpected message was received.

[`var errSSLPeerUserCancelled: OSStatus`](/documentation/Security/errSSLPeerUserCancelled)

The user canceled the operation.

[`var errSSLProtocol: OSStatus`](/documentation/Security/errSSLProtocol)

SSL protocol error.

[`var errSSLRecordOverflow: OSStatus`](/documentation/Security/errSSLRecordOverflow)

A record overflow occurred.

[`var errSSLSessionNotFound: OSStatus`](/documentation/Security/errSSLSessionNotFound)

An attempt to restore an unknown session failed.

[`var errSSLTransportReset: OSStatus`](/documentation/Security/errSSLTransportReset)

Transport (socket) shutdown, for example, TCP RST or FIN.

[`var errSSLUnexpectedMessage: OSStatus`](/documentation/Security/errSSLUnexpectedMessage)

Peer rejected unexpected message.

[`var errSSLUnexpectedRecord: OSStatus`](/documentation/Security/errSSLUnexpectedRecord)

[`var errSSLUnknownPSKIdentity: OSStatus`](/documentation/Security/errSSLUnknownPSKIdentity)

Unknown PSK identity.

[`var errSSLUnrecognizedName: OSStatus`](/documentation/Security/errSSLUnrecognizedName)

Unknown or unrecognized name.

[`var errSSLUnsupportedExtension: OSStatus`](/documentation/Security/errSSLUnsupportedExtension)

Unsupported TLS extension.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)