<!--
{
  "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

[`errSSLATSViolation`](/documentation/Security/errSSLATSViolation)

An App Transport Security violation occurred.

[`errSSLATSMinimumVersionViolation`](/documentation/Security/errSSLATSMinimumVersionViolation)

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

[`errSSLATSCiphersuiteViolation`](/documentation/Security/errSSLATSCiphersuiteViolation)

The selected ciphersuite isn’t App Transport Security compliant.

[`errSSLATSMinimumKeySizeViolation`](/documentation/Security/errSSLATSMinimumKeySizeViolation)

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

[`errSSLATSLeafCertificateHashAlgorithmViolation`](/documentation/Security/errSSLATSLeafCertificateHashAlgorithmViolation)

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

[`errSSLATSCertificateHashAlgorithmViolation`](/documentation/Security/errSSLATSCertificateHashAlgorithmViolation)

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

[`errSSLATSCertificateTrustViolation`](/documentation/Security/errSSLATSCertificateTrustViolation)

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

### Certificate issue result codes

[`errSSLBadCert`](/documentation/Security/errSSLBadCert)

Bad certificate format.

[`errSSLBadCertificateStatusResponse`](/documentation/Security/errSSLBadCertificateStatusResponse)

Bad OCSP response.

[`errSSLCertExpired`](/documentation/Security/errSSLCertExpired)

The certificate chain had an expired certificate.

[`errSSLCertNotYetValid`](/documentation/Security/errSSLCertNotYetValid)

The certificate chain had a certificatethat is not yet valid.

[`errSSLCertificateRequired`](/documentation/Security/errSSLCertificateRequired)

Certificate required.

[`errSSLClientCertRequested`](/documentation/Security/errSSLClientCertRequested)

The server has requested a client certificate.

[`errSSLHostNameMismatch`](/documentation/Security/errSSLHostNameMismatch)

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

[`errSSLNoRootCert`](/documentation/Security/errSSLNoRootCert)

No root certificate for the certificate chain.

[`errSSLPeerBadCert`](/documentation/Security/errSSLPeerBadCert)

A bad certificate was encountered.

[`errSSLPeerCertExpired`](/documentation/Security/errSSLPeerCertExpired)

The certificate expired.

[`errSSLPeerCertRevoked`](/documentation/Security/errSSLPeerCertRevoked)

The certificate was revoked.

[`errSSLPeerCertUnknown`](/documentation/Security/errSSLPeerCertUnknown)

The certificate is unknown.

[`errSSLPeerUnsupportedCert`](/documentation/Security/errSSLPeerUnsupportedCert)

An unsupported certificate format was encountered.

[`errSSLUnknownRootCert`](/documentation/Security/errSSLUnknownRootCert)

Certificate chain is valid, but root is nottrusted.

[`errSSLXCertChainInvalid`](/documentation/Security/errSSLXCertChainInvalid)

Invalid certificate chain.

[`errSSLPeerUnknownCA`](/documentation/Security/errSSLPeerUnknownCA)

An unknown certificate authority was encountered.

### Connection status result codes

[`errSSLClientHelloReceived`](/documentation/Security/errSSLClientHelloReceived)

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

[`errSSLClosedAbort`](/documentation/Security/errSSLClosedAbort)

The connection closed due to an error.

[`errSSLClosedGraceful`](/documentation/Security/errSSLClosedGraceful)

The connection closed gracefully.

[`errSSLClosedNoNotify`](/documentation/Security/errSSLClosedNoNotify)

The server closed the session with no notification.

[`errSSLConnectionRefused`](/documentation/Security/errSSLConnectionRefused)

The peer dropped the connection before responding.

[`errSSLPeerAuthCompleted`](/documentation/Security/errSSLPeerAuthCompleted)

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

[`errSSLWouldBlock`](/documentation/Security/errSSLWouldBlock)

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

### Cryptography result codes

[`errSSLCrypto`](/documentation/Security/errSSLCrypto)

An underlying cryptographic error was encountered.

[`errSSLDecryptionFail`](/documentation/Security/errSSLDecryptionFail)

Decryption failed.

[`errSSLPeerDecryptError`](/documentation/Security/errSSLPeerDecryptError)

A decryption error occurred.

[`errSSLPeerDecryptionFail`](/documentation/Security/errSSLPeerDecryptionFail)

Decryption failed.

[`errSSLWeakPeerEphemeralDHKey`](/documentation/Security/errSSLWeakPeerEphemeralDHKey)

Indicates a weak ephemeral dh key.

### Other result codes

[`errSSLBadCipherSuite`](/documentation/Security/errSSLBadCipherSuite)

A bad SSL cipher suite was encountered.

[`errSSLBadConfiguration`](/documentation/Security/errSSLBadConfiguration)

A configuration error occurred.

[`errSSLBadRecordMac`](/documentation/Security/errSSLBadRecordMac)

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

[`errSSLBufferOverflow`](/documentation/Security/errSSLBufferOverflow)

An insufficient buffer was provided.

[`errSSLConfigurationFailed`](/documentation/Security/errSSLConfigurationFailed)

TLS configuration failed.

[`errSSLDecodeError`](/documentation/Security/errSSLDecodeError)

Decode failed.

[`errSSLDecompressFail`](/documentation/Security/errSSLDecompressFail)

Decompression failed.

[`errSSLFatalAlert`](/documentation/Security/errSSLFatalAlert)

A fatal alert was encountered.

[`errSSLHandshakeFail`](/documentation/Security/errSSLHandshakeFail)

Handshake failed.

[`errSSLIllegalParam`](/documentation/Security/errSSLIllegalParam)

An illegal parameter was encountered.

[`errSSLInappropriateFallback`](/documentation/Security/errSSLInappropriateFallback)

Inappropriate fallback.

[`errSSLInternal`](/documentation/Security/errSSLInternal)

Internal error.

[`errSSLMissingExtension`](/documentation/Security/errSSLMissingExtension)

Missing extension.

[`errSSLModuleAttach`](/documentation/Security/errSSLModuleAttach)

Module attach failure.

[`errSSLNegotiation`](/documentation/Security/errSSLNegotiation)

The cipher suite negotiation failed.

[`errSSLNetworkTimeout`](/documentation/Security/errSSLNetworkTimeout)

Network timeout triggered.

[`errSSLPeerAccessDenied`](/documentation/Security/errSSLPeerAccessDenied)

Access was denied.

[`errSSLPeerBadRecordMac`](/documentation/Security/errSSLPeerBadRecordMac)

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

[`errSSLPeerDecodeError`](/documentation/Security/errSSLPeerDecodeError)

A decoding error occurred.

[`errSSLPeerDecompressFail`](/documentation/Security/errSSLPeerDecompressFail)

Decompression failed.

[`errSSLPeerExportRestriction`](/documentation/Security/errSSLPeerExportRestriction)

An export restriction occurred.

[`errSSLPeerHandshakeFail`](/documentation/Security/errSSLPeerHandshakeFail)

The handshake failed.

[`errSSLPeerInsufficientSecurity`](/documentation/Security/errSSLPeerInsufficientSecurity)

There is insufficient security for this operation.

[`errSSLPeerInternalError`](/documentation/Security/errSSLPeerInternalError)

An internal error occurred.

[`errSSLPeerNoRenegotiation`](/documentation/Security/errSSLPeerNoRenegotiation)

No renegotiation is allowed.

[`errSSLPeerProtocolVersion`](/documentation/Security/errSSLPeerProtocolVersion)

A bad protocol version was encountered.

[`errSSLPeerRecordOverflow`](/documentation/Security/errSSLPeerRecordOverflow)

A record overflow occurred.

[`errSSLPeerUnexpectedMsg`](/documentation/Security/errSSLPeerUnexpectedMsg)

An unexpected message was received.

[`errSSLPeerUserCancelled`](/documentation/Security/errSSLPeerUserCancelled)

The user canceled the operation.

[`errSSLProtocol`](/documentation/Security/errSSLProtocol)

SSL protocol error.

[`errSSLRecordOverflow`](/documentation/Security/errSSLRecordOverflow)

A record overflow occurred.

[`errSSLSessionNotFound`](/documentation/Security/errSSLSessionNotFound)

An attempt to restore an unknown session failed.

[`errSSLTransportReset`](/documentation/Security/errSSLTransportReset)

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

[`errSSLUnexpectedMessage`](/documentation/Security/errSSLUnexpectedMessage)

Peer rejected unexpected message.

[`errSSLUnexpectedRecord`](/documentation/Security/errSSLUnexpectedRecord)

[`errSSLUnknownPSKIdentity`](/documentation/Security/errSSLUnknownPSKIdentity)

Unknown PSK identity.

[`errSSLUnrecognizedName`](/documentation/Security/errSSLUnrecognizedName)

Unknown or unrecognized name.

[`errSSLUnsupportedExtension`](/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)