哪里有对 iOS 和 Mac OS X 网络错误(如 kCFStreamErrorDomainSSL)的清晰、完整的引用?

Where is a clear, complete reference to iOS and Mac OS X networking errors like kCFStreamErrorDomainSSL?

在 Xcode 中调试网络代码时,我经常 运行 出现如下错误序列:

NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802)

None 我研究这些错误的努力得到了对它们的引用,因此我可以按顺序调试它们,而无需对每个单独的错误进行研究。

经过大量搜索,我发现 Apple 自己的参考页面没有 link 相应的错误编号。然后我能够在源代码中找到适当的错误列表和枚举:

https://developer.apple.com/library/mac/documentation/CoreFoundation/Reference/CFStreamConstants/#//apple_ref/doc/constant_group/CFStream_Error_Domain_Constants_CFHost_

https://developer.apple.com/library/mac/documentation/Security/Reference/secureTransportRef/

http://www.opensource.apple.com/source/libsecurity_ssl/libsecurity_ssl-36800/lib/SecureTransport.h

enum {
errSSLProtocol              = -9800,    /* SSL protocol error */
errSSLNegotiation           = -9801,    /* Cipher Suite negotiation failure */
errSSLFatalAlert            = -9802,    /* Fatal alert */
errSSLWouldBlock            = -9803,    /* I/O would block (not fatal) */
errSSLSessionNotFound       = -9804,    /* attempt to restore an unknown session */
errSSLClosedGraceful        = -9805,    /* connection closed gracefully */
errSSLClosedAbort           = -9806,    /* connection closed via error */
errSSLXCertChainInvalid     = -9807,    /* invalid certificate chain */
errSSLBadCert               = -9808,    /* bad certificate format */
errSSLCrypto                = -9809,    /* underlying cryptographic error */
errSSLInternal              = -9810,    /* Internal error */
errSSLModuleAttach          = -9811,    /* module attach failure */
errSSLUnknownRootCert       = -9812,    /* valid cert chain, untrusted root */
errSSLNoRootCert            = -9813,    /* cert chain not verified by root */
errSSLCertExpired           = -9814,    /* chain had an expired cert */
errSSLCertNotYetValid       = -9815,    /* chain had a cert not yet valid */
errSSLClosedNoNotify        = -9816,    /* server closed session with no notification */
errSSLBufferOverflow        = -9817,    /* insufficient buffer provided */
errSSLBadCipherSuite        = -9818,    /* bad SSLCipherSuite */

/* fatal errors detected by peer */
errSSLPeerUnexpectedMsg     = -9819,    /* unexpected message received */
errSSLPeerBadRecordMac      = -9820,    /* bad MAC */
errSSLPeerDecryptionFail    = -9821,    /* decryption failed */
errSSLPeerRecordOverflow    = -9822,    /* record overflow */
errSSLPeerDecompressFail    = -9823,    /* decompression failure */
errSSLPeerHandshakeFail     = -9824,    /* handshake failure */
errSSLPeerBadCert           = -9825,    /* misc. bad certificate */
errSSLPeerUnsupportedCert   = -9826,    /* bad unsupported cert format */
errSSLPeerCertRevoked       = -9827,    /* certificate revoked */
errSSLPeerCertExpired       = -9828,    /* certificate expired */
errSSLPeerCertUnknown       = -9829,    /* unknown certificate */
errSSLIllegalParam          = -9830,    /* illegal parameter */
errSSLPeerUnknownCA         = -9831,    /* unknown Cert Authority */
errSSLPeerAccessDenied      = -9832,    /* access denied */
errSSLPeerDecodeError       = -9833,    /* decoding error */
errSSLPeerDecryptError      = -9834,    /* decryption error */
errSSLPeerExportRestriction = -9835,    /* export restriction */
errSSLPeerProtocolVersion   = -9836,    /* bad protocol version */
errSSLPeerInsufficientSecurity = -9837, /* insufficient security */
errSSLPeerInternalError     = -9838,    /* internal error */
errSSLPeerUserCancelled     = -9839,    /* user canceled */
errSSLPeerNoRenegotiation   = -9840,    /* no renegotiation allowed */

/* non-fatal result codes */
errSSLServerAuthCompleted   = -9841,    /* server cert is valid, or was ignored if verification disabled */
errSSLClientCertRequested   = -9842,    /* server has requested a client cert */

/* more errors detected by us */
errSSLHostNameMismatch      = -9843,    /* peer host name mismatch */
errSSLConnectionRefused     = -9844,    /* peer dropped connection before responding */
errSSLDecryptionFail        = -9845,    /* decryption failure */
errSSLBadRecordMac          = -9846,    /* bad MAC */
errSSLRecordOverflow        = -9847,    /* record overflow */
errSSLBadConfiguration      = -9848,    /* configuration error */
errSSLLast                  = -9849     /* end of range, to be deleted */
};

TL;DR 没有网页(现在除了这个)有单词 kCFStreamErrorDomainSSL 和错误号,甚至没有 Apple 参考页。

有几个不错的错误代码网站:

2357 List Of Mac OS X Error Codes 还有命令、指南和工具
897Macintosh Error Codes

但不幸的是,这两个都没有关于 -9802 的信息。

建议:bugreport.apple.com

据我所知,最近的努力是 osstatus.com

该站点将错误 [​​=14=] 识别为 errSSLFatalAlert 来自 SecureTransport.h