<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.8.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CFNetwork",
  "identifier" : "/documentation/CFNetwork/CFNetworkErrors",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "CFNetwork"
    ],
    "preciseIdentifier" : "c:@E@CFNetworkErrors"
  },
  "title" : "CFNetworkErrors"
}
-->

# CFNetworkErrors

This enumeration contains error codes returned under the error domain [`kCFErrorDomainCFNetwork`](/documentation/CFNetwork/kCFErrorDomainCFNetwork).

```
enum CFNetworkErrors
```

## Overview

To determine the source of an error, examine the `userInfo` dictionary included in the `CFError` object returned by a function call or call <doc://com.apple.documentation/documentation/CoreFoundation/CFErrorGetDomain(_:)> and pass in the `CFError` object and the domain whose value you want to read. These errors are all part of the `kCFErrorDomainCFNetwork` domain.

## Topics

### Constants

[`kCFHostErrorHostNotFound`](/documentation/CFNetwork/CFNetworkErrors/cfHostErrorHostNotFound)

The specified host wasn’t found.

[`kCFHostErrorUnknown`](/documentation/CFNetwork/CFNetworkErrors/cfHostErrorUnknown)

An unknown error.

[`kCFSOCKSErrorUnknownClientVersion`](/documentation/CFNetwork/CFNetworkErrors/cfsocksErrorUnknownClientVersion)

The SOCKS server rejected access because it doesn’t support connections with the requested SOCKS version.

[`kCFSOCKSErrorUnsupportedServerVersion`](/documentation/CFNetwork/CFNetworkErrors/cfsocksErrorUnsupportedServerVersion)

The SOCKS server doesn’t support the requested version.

[`kCFSOCKS4ErrorRequestFailed`](/documentation/CFNetwork/CFNetworkErrors/cfsocks4ErrorRequestFailed)

The server rejected the request, or the request failed.

[`kCFSOCKS4ErrorIdentdFailed`](/documentation/CFNetwork/CFNetworkErrors/cfsocks4ErrorIdentdFailed)

The server couldn’t connect to the `identd` daemon on the client and rejected the request.

[`kCFSOCKS4ErrorIdConflict`](/documentation/CFNetwork/CFNetworkErrors/cfsocks4ErrorIdConflict)

The server rejected the request because the client program and the `identd` daemon reported different user IDs.

[`kCFSOCKS4ErrorUnknownStatusCode`](/documentation/CFNetwork/CFNetworkErrors/cfsocks4ErrorUnknownStatusCode)

The server returned an unknown status code.

[`kCFSOCKS5ErrorBadState`](/documentation/CFNetwork/CFNetworkErrors/cfsocks5ErrorBadState)

The stream isn’t in a state that allows the requested operation.

[`kCFSOCKS5ErrorBadResponseAddr`](/documentation/CFNetwork/CFNetworkErrors/cfsocks5ErrorBadResponseAddr)

The address type returned isn’t supported.

[`kCFSOCKS5ErrorBadCredentials`](/documentation/CFNetwork/CFNetworkErrors/cfsocks5ErrorBadCredentials)

The SOCKS server refused the client connection because of bad login credentials.

[`kCFSOCKS5ErrorUnsupportedNegotiationMethod`](/documentation/CFNetwork/CFNetworkErrors/cfsocks5ErrorUnsupportedNegotiationMethod)

The requested method isn’t supported.

[`kCFSOCKS5ErrorNoAcceptableMethod`](/documentation/CFNetwork/CFNetworkErrors/cfsocks5ErrorNoAcceptableMethod)

The client and server couldn’t find a mutually agreeable authentication method.

[`kCFFTPErrorUnexpectedStatusCode`](/documentation/CFNetwork/CFNetworkErrors/cfftpErrorUnexpectedStatusCode)

The server returned an unexpected status code.

[`kCFErrorHTTPAuthenticationTypeUnsupported`](/documentation/CFNetwork/CFNetworkErrors/cfErrorHTTPAuthenticationTypeUnsupported)

The client and server couldn’t agree on a supported authentication type.

[`kCFErrorHTTPBadCredentials`](/documentation/CFNetwork/CFNetworkErrors/cfErrorHTTPBadCredentials)

The server rejected the credentials provided for an authenticated connection.

[`kCFErrorHTTPConnectionLost`](/documentation/CFNetwork/CFNetworkErrors/cfErrorHTTPConnectionLost)

The connection to the server was dropped.

[`kCFErrorHTTPParseFailure`](/documentation/CFNetwork/CFNetworkErrors/cfErrorHTTPParseFailure)

The HTTP server response couldn’t be parsed.

[`kCFErrorHTTPRedirectionLoopDetected`](/documentation/CFNetwork/CFNetworkErrors/cfErrorHTTPRedirectionLoopDetected)

Too many HTTP redirects occurred before reaching a page that didn’t redirect the client to another page.

[`kCFErrorHTTPBadURL`](/documentation/CFNetwork/CFNetworkErrors/cfErrorHTTPBadURL)

The requested URL couldn’t be retrieved.

[`kCFErrorHTTPProxyConnectionFailure`](/documentation/CFNetwork/CFNetworkErrors/cfErrorHTTPProxyConnectionFailure)

A connection to the HTTPS proxy couldn’t be established.

[`kCFErrorHTTPBadProxyCredentials`](/documentation/CFNetwork/CFNetworkErrors/cfErrorHTTPBadProxyCredentials)

The proxy rejected the authentication credentials provided for logging in.

[`kCFErrorPACFileError`](/documentation/CFNetwork/CFNetworkErrors/cfErrorPACFileError)

An error occurred with the proxy autoconfiguration file.

[`kCFErrorPACFileAuth`](/documentation/CFNetwork/CFNetworkErrors/cfErrorPACFileAuth)

The authentication credentials provided by the proxy autoconfiguration file were rejected.

[`kCFErrorHTTPSProxyConnectionFailure`](/documentation/CFNetwork/CFNetworkErrors/cfErrorHTTPSProxyConnectionFailure)

A connection couldn’t be established to the HTTPS proxy.

[`kCFStreamErrorHTTPSProxyFailureUnexpectedResponseToCONNECTMethod`](/documentation/CFNetwork/CFNetworkErrors/cfStreamErrorHTTPSProxyFailureUnexpectedResponseToCONNECTMethod)

The HTTPS proxy returned an unexpected status code, such as a `3xx` redirect.

[`kCFURLErrorUnknown`](/documentation/CFNetwork/CFNetworkErrors/cfurlErrorUnknown)

An unknown error occurred.

[`kCFURLErrorCancelled`](/documentation/CFNetwork/CFNetworkErrors/cfurlErrorCancelled)

The connection was cancelled.

[`kCFURLErrorBadURL`](/documentation/CFNetwork/CFNetworkErrors/cfurlErrorBadURL)

The connection failed due to a malformed URL.

[`kCFURLErrorTimedOut`](/documentation/CFNetwork/CFNetworkErrors/cfurlErrorTimedOut)

The connection timed out.

[`kCFURLErrorUnsupportedURL`](/documentation/CFNetwork/CFNetworkErrors/cfurlErrorUnsupportedURL)

The connection failed due to an unsupported URL scheme.

[`kCFURLErrorCannotFindHost`](/documentation/CFNetwork/CFNetworkErrors/cfurlErrorCannotFindHost)

The connection failed because the host couldn’t be found.

[`kCFURLErrorCannotConnectToHost`](/documentation/CFNetwork/CFNetworkErrors/cfurlErrorCannotConnectToHost)

The connection failed because a connection can’t be made to the host.

[`kCFURLErrorNetworkConnectionLost`](/documentation/CFNetwork/CFNetworkErrors/cfurlErrorNetworkConnectionLost)

The connection failed because the network connection was lost.

[`kCFURLErrorDNSLookupFailed`](/documentation/CFNetwork/CFNetworkErrors/cfurlErrorDNSLookupFailed)

The connection failed because the DNS lookup failed.

[`kCFURLErrorHTTPTooManyRedirects`](/documentation/CFNetwork/CFNetworkErrors/cfurlErrorHTTPTooManyRedirects)

The HTTP connection failed due to too many redirects.

[`kCFURLErrorResourceUnavailable`](/documentation/CFNetwork/CFNetworkErrors/cfurlErrorResourceUnavailable)

The connection’s resource is unavailable.

[`kCFURLErrorNotConnectedToInternet`](/documentation/CFNetwork/CFNetworkErrors/cfurlErrorNotConnectedToInternet)

The connection failed because the device isn’t connected to the internet.

[`kCFURLErrorRedirectToNonExistentLocation`](/documentation/CFNetwork/CFNetworkErrors/cfurlErrorRedirectToNonExistentLocation)

The connection was redirected to a nonexistent location.

[`kCFURLErrorBadServerResponse`](/documentation/CFNetwork/CFNetworkErrors/cfurlErrorBadServerResponse)

The connection received an invalid server response.

[`kCFURLErrorUserCancelledAuthentication`](/documentation/CFNetwork/CFNetworkErrors/cfurlErrorUserCancelledAuthentication)

The connection failed because the user cancelled required authentication.

[`kCFURLErrorUserAuthenticationRequired`](/documentation/CFNetwork/CFNetworkErrors/cfurlErrorUserAuthenticationRequired)

The connection failed because it requires authentication.

[`kCFURLErrorZeroByteResource`](/documentation/CFNetwork/CFNetworkErrors/cfurlErrorZeroByteResource)

The resource retrieved by the connection is zero bytes.

[`kCFURLErrorCannotDecodeRawData`](/documentation/CFNetwork/CFNetworkErrors/cfurlErrorCannotDecodeRawData)

The connection can’t decode data encoded with a known content encoding.

[`kCFURLErrorCannotDecodeContentData`](/documentation/CFNetwork/CFNetworkErrors/cfurlErrorCannotDecodeContentData)

The connection can’t decode data encoded with an unknown content encoding.

[`kCFURLErrorCannotParseResponse`](/documentation/CFNetwork/CFNetworkErrors/cfurlErrorCannotParseResponse)

The connection can’t parse the server’s response.

[`kCFURLErrorInternationalRoamingOff`](/documentation/CFNetwork/CFNetworkErrors/cfurlErrorInternationalRoamingOff)

The connection failed because international roaming is disabled on the device.

[`kCFURLErrorCallIsActive`](/documentation/CFNetwork/CFNetworkErrors/cfurlErrorCallIsActive)

The connection failed because a call is active.

[`kCFURLErrorDataNotAllowed`](/documentation/CFNetwork/CFNetworkErrors/cfurlErrorDataNotAllowed)

The connection failed because data use isn’t currently allowed on the device.

[`kCFURLErrorRequestBodyStreamExhausted`](/documentation/CFNetwork/CFNetworkErrors/cfurlErrorRequestBodyStreamExhausted)

The connection failed because the request’s body stream was exhausted.

[`kCFURLErrorFileDoesNotExist`](/documentation/CFNetwork/CFNetworkErrors/cfurlErrorFileDoesNotExist)

The file operation failed because the file doesn’t exist.

[`kCFURLErrorFileIsDirectory`](/documentation/CFNetwork/CFNetworkErrors/cfurlErrorFileIsDirectory)

The file operation failed because the file is a directory.

[`kCFURLErrorNoPermissionsToReadFile`](/documentation/CFNetwork/CFNetworkErrors/cfurlErrorNoPermissionsToReadFile)

The file operation failed because it doesn’t have permission to read the file.

[`kCFURLErrorDataLengthExceedsMaximum`](/documentation/CFNetwork/CFNetworkErrors/cfurlErrorDataLengthExceedsMaximum)

The file operation failed because the file is too large.

[`kCFURLErrorSecureConnectionFailed`](/documentation/CFNetwork/CFNetworkErrors/cfurlErrorSecureConnectionFailed)

The secure connection failed for an unknown reason.

[`kCFURLErrorServerCertificateHasBadDate`](/documentation/CFNetwork/CFNetworkErrors/cfurlErrorServerCertificateHasBadDate)

The secure connection failed because the server’s certificate has an invalid date.

[`kCFURLErrorServerCertificateUntrusted`](/documentation/CFNetwork/CFNetworkErrors/cfurlErrorServerCertificateUntrusted)

The secure connection failed because the server’s certificate isn’t trusted.

[`kCFURLErrorServerCertificateHasUnknownRoot`](/documentation/CFNetwork/CFNetworkErrors/cfurlErrorServerCertificateHasUnknownRoot)

The secure connection failed because the server’s certificate has an unknown root.

[`kCFURLErrorServerCertificateNotYetValid`](/documentation/CFNetwork/CFNetworkErrors/cfurlErrorServerCertificateNotYetValid)

The secure connection failed because the server’s certificate isn’t valid yet.

[`kCFURLErrorClientCertificateRejected`](/documentation/CFNetwork/CFNetworkErrors/cfurlErrorClientCertificateRejected)

The secure connection failed because the client’s certificate was rejected.

[`kCFURLErrorClientCertificateRequired`](/documentation/CFNetwork/CFNetworkErrors/cfurlErrorClientCertificateRequired)

The secure connection failed because the server requires a client certificate.

[`kCFURLErrorCannotLoadFromNetwork`](/documentation/CFNetwork/CFNetworkErrors/cfurlErrorCannotLoadFromNetwork)

The connection failed because it’s being required to return a cached resource, but one isn’t available.

[`kCFURLErrorCannotCreateFile`](/documentation/CFNetwork/CFNetworkErrors/cfurlErrorCannotCreateFile)

The file can’t be created.

[`kCFURLErrorCannotOpenFile`](/documentation/CFNetwork/CFNetworkErrors/cfurlErrorCannotOpenFile)

The file can’t be opened.

[`kCFURLErrorCannotCloseFile`](/documentation/CFNetwork/CFNetworkErrors/cfurlErrorCannotCloseFile)

The file can’t be closed.

[`kCFURLErrorCannotWriteToFile`](/documentation/CFNetwork/CFNetworkErrors/cfurlErrorCannotWriteToFile)

The file can’t be written.

[`kCFURLErrorCannotRemoveFile`](/documentation/CFNetwork/CFNetworkErrors/cfurlErrorCannotRemoveFile)

The file can’t be removed.

[`kCFURLErrorCannotMoveFile`](/documentation/CFNetwork/CFNetworkErrors/cfurlErrorCannotMoveFile)

The file can’t be moved.

[`kCFURLErrorDownloadDecodingFailedMidStream`](/documentation/CFNetwork/CFNetworkErrors/cfurlErrorDownloadDecodingFailedMidStream)

The download failed because decoding of the downloaded data failed midstream.

[`kCFURLErrorDownloadDecodingFailedToComplete`](/documentation/CFNetwork/CFNetworkErrors/cfurlErrorDownloadDecodingFailedToComplete)

The download failed because decoding of the downloaded data failed to complete.

[`kCFHTTPCookieCannotParseCookieFile`](/documentation/CFNetwork/CFNetworkErrors/cfhttpCookieCannotParseCookieFile)

The cookie file can’t be parsed.

[`kCFNetServiceErrorUnknown`](/documentation/CFNetwork/CFNetworkErrors/cfNetServiceErrorUnknown)

An error of unknown type has occurred.

[`kCFNetServiceErrorCollision`](/documentation/CFNetwork/CFNetworkErrors/cfNetServiceErrorCollision)

An attempt was made to use a name that’s already in use.

[`kCFNetServiceErrorNotFound`](/documentation/CFNetwork/CFNetworkErrors/cfNetServiceErrorNotFound)

This error isn’t used.

[`kCFNetServiceErrorInProgress`](/documentation/CFNetwork/CFNetworkErrors/cfNetServiceErrorInProgress)

A new search couldn’t be started because a search is already in progress.

[`kCFNetServiceErrorBadArgument`](/documentation/CFNetwork/CFNetworkErrors/cfNetServiceErrorBadArgument)

A required argument either wasn’t provided or wasn’t valid.

[`kCFNetServiceErrorCancel`](/documentation/CFNetwork/CFNetworkErrors/cfNetServiceErrorCancel)

The search or service was canceled.

[`kCFNetServiceErrorInvalid`](/documentation/CFNetwork/CFNetworkErrors/cfNetServiceErrorInvalid)

Invalid data was passed to a CFNetServices function.

[`kCFNetServiceErrorTimeout`](/documentation/CFNetwork/CFNetworkErrors/cfNetServiceErrorTimeout)

Resolution failed because the timeout was reached.

[`kCFNetServiceErrorDNSServiceFailure`](/documentation/CFNetwork/CFNetworkErrors/cfNetServiceErrorDNSServiceFailure)

The DNS service discovery returned an error.

[`kCFURLErrorAppTransportSecurityRequiresSecureConnection`](/documentation/CFNetwork/CFNetworkErrors/cfurlErrorAppTransportSecurityRequiresSecureConnection)

The connection failed because the App Transport Security configuration requires a secure connection.

[`kCFURLErrorBackgroundSessionInUseByAnotherProcess`](/documentation/CFNetwork/CFNetworkErrors/cfurlErrorBackgroundSessionInUseByAnotherProcess)

The background session failed because it was in use by another process.

[`kCFURLErrorBackgroundSessionWasDisconnected`](/documentation/CFNetwork/CFNetworkErrors/cfurlErrorBackgroundSessionWasDisconnected)

The background session failed because it was disconnected.

### Enumeration Cases

[`kCFURLErrorFileOutsideSafeArea`](/documentation/CFNetwork/CFNetworkErrors/cfurlErrorFileOutsideSafeArea)

The file is outside of the safe area.

## Relationships

### Conforms To

[`Sendable`](/documentation/Swift/Sendable)

[`Hashable`](/documentation/Swift/Hashable)

[`RawRepresentable`](/documentation/Swift/RawRepresentable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Equatable`](/documentation/Swift/Equatable)

[`BitwiseCopyable`](/documentation/Swift/BitwiseCopyable)

---

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)