1 /* 2 * 3 * Copyright 2020 gRPC authors. 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 * 17 */ 18 19 #ifndef GRPC_CORE_EXT_TRANSPORT_CRONET_TRANSPORT_CRONET_STATUS_H 20 #define GRPC_CORE_EXT_TRANSPORT_CRONET_TRANSPORT_CRONET_STATUS_H 21 22 #include <grpc/impl/codegen/port_platform.h> 23 24 enum cronet_net_error_code { 25 // 26 // Ranges: 27 // 0- 99 System related errors 28 // 100-199 Connection related errors 29 // 200-299 Certificate errors 30 // 300-399 HTTP errors 31 // 400-499 Cache errors 32 // 500-599 ? 33 // 600-699 FTP errors 34 // 700-799 Certificate manager errors 35 // 800-899 DNS resolver errors 36 37 // An asynchronous IO operation is not yet complete. This usually does not 38 // indicate a fatal error. Typically this error will be generated as a 39 // notification to wait for some external notification that the IO operation 40 // finally completed. 41 OK = 0, 42 CRONET_NET_ERROR_IO_PENDING = -1, 43 44 // A generic failure occurred. 45 CRONET_NET_ERROR_FAILED = -2, 46 47 // An operation was aborted (due to user action,. 48 CRONET_NET_ERROR_ABORTED = -3, 49 50 // An argument to the function is incorrect. 51 CRONET_NET_ERROR_INVALID_ARGUMENT = -4, 52 53 // The handle or file descriptor is invalid. 54 CRONET_NET_ERROR_INVALID_HANDLE = -5, 55 56 // The file or directory cannot be found. 57 CRONET_NET_ERROR_FILE_NOT_FOUND = -6, 58 59 // An operation timed out. 60 CRONET_NET_ERROR_TIMED_OUT = -7, 61 62 // The file is too large. 63 CRONET_NET_ERROR_FILE_TOO_BIG = -8, 64 65 // An unexpected error. This may be caused by a programming mistake or an 66 // invalid assumption. 67 CRONET_NET_ERROR_UNEXPECTED = -9, 68 69 // Permission to access a resource = other than the network = was denied. 70 CRONET_NET_ERROR_ACCESS_DENIED = -10, 71 72 // The operation failed because of unimplemented functionality. 73 CRONET_NET_ERROR_NOT_IMPLEMENTED = -11, 74 75 // There were not enough resources to complete the operation. 76 CRONET_NET_ERROR_INSUFFICIENT_RESOURCES = -12, 77 78 // Memory allocation failed. 79 CRONET_NET_ERROR_OUT_OF_MEMORY = -13, 80 81 // The file upload failed because the file's modification time was different 82 // from the expectation. 83 CRONET_NET_ERROR_UPLOAD_FILE_CHANGED = -14, 84 85 // The socket is not connected. 86 CRONET_NET_ERROR_SOCKET_NOT_CONNECTED = -15, 87 88 // The file already exists. 89 CRONET_NET_ERROR_FILE_EXISTS = -16, 90 91 // The path or file name is too long. 92 CRONET_NET_ERROR_FILE_PATH_TOO_LONG = -17, 93 94 // Not enough room left on the disk. 95 CRONET_NET_ERROR_FILE_NO_SPACE = -18, 96 97 // The file has a virus. 98 CRONET_NET_ERROR_FILE_VIRUS_INFECTED = -19, 99 100 // The client chose to block the request. 101 CRONET_NET_ERROR_BLOCKED_BY_CLIENT = -20, 102 103 // The network changed. 104 CRONET_NET_ERROR_NETWORK_CHANGED = -21, 105 106 // The request was blocked by the URL block list configured by the domain 107 // administrator. 108 CRONET_NET_ERROR_BLOCKED_BY_ADMINISTRATOR = -22, 109 110 // The socket is already connected. 111 CRONET_NET_ERROR_SOCKET_IS_CONNECTED = -23, 112 113 // The request was blocked because the forced reenrollment check is still 114 // pending. This error can only occur on ChromeOS. 115 // The error can be emitted by code in 116 // chrome/browser/policy/policy_helpers.cc. 117 CRONET_NET_ERROR_BLOCKED_ENROLLMENT_CHECK_PENDING = -24, 118 119 // The upload failed because the upload stream needed to be re-read = due to a 120 // retry or a redirect = but the upload stream doesn't support that operation. 121 CRONET_NET_ERROR_UPLOAD_STREAM_REWIND_NOT_SUPPORTED = -25, 122 123 // The request failed because the URLRequestContext is shutting down = or has 124 // been shut down. 125 CRONET_NET_ERROR_CONTEXT_SHUT_DOWN = -26, 126 127 // The request failed because the response was delivered along with 128 // requirements 129 // which are not met ('X-Frame-Options' and 'Content-Security-Policy' ancestor 130 // checks and 'Cross-Origin-Resource-Policy' = for instance,. 131 CRONET_NET_ERROR_BLOCKED_BY_RESPONSE = -27, 132 133 // Error -28 was removed (BLOCKED_BY_XSS_AUDITOR,. 134 135 // The request was blocked by system policy disallowing some or all cleartext 136 // requests. Used for NetworkSecurityPolicy on Android. 137 CRONET_NET_ERROR_CLEARTEXT_NOT_PERMITTED = -29, 138 139 // The request was blocked by a Content Security Policy 140 CRONET_NET_ERROR_BLOCKED_BY_CSP = -30, 141 142 // The request was blocked because of no H/2 or QUIC session. 143 CRONET_NET_ERROR_H2_OR_QUIC_REQUIRED = -31, 144 145 // The request was blocked because it is a private network request coming from 146 // an insecure context in a less private IP address space. This is used to 147 // enforce CORS-RFC1918: https: //wicg.github.io/cors-rfc1918. 148 CRONET_NET_ERROR_INSECURE_PRIVATE_NETWORK_REQUEST = -32, 149 150 // A connection was closed (corresponding to a TCP FIN,. 151 CRONET_NET_ERROR_CONNECTION_CLOSED = -100, 152 153 // A connection was reset (corresponding to a TCP RST,. 154 CRONET_NET_ERROR_CONNECTION_RESET = -101, 155 156 // A connection attempt was refused. 157 CRONET_NET_ERROR_CONNECTION_REFUSED = -102, 158 159 // A connection timed out as a result of not receiving an ACK for data sent. 160 // This can include a FIN packet that did not get ACK'd. 161 CRONET_NET_ERROR_CONNECTION_ABORTED = -103, 162 163 // A connection attempt failed. 164 CRONET_NET_ERROR_CONNECTION_FAILED = -104, 165 166 // The host name could not be resolved. 167 CRONET_NET_ERROR_NAME_NOT_RESOLVED = -105, 168 169 // The Internet connection has been lost. 170 CRONET_NET_ERROR_INTERNET_DISCONNECTED = -106, 171 172 // An SSL protocol error occurred. 173 CRONET_NET_ERROR_SSL_PROTOCOL_ERROR = -107, 174 175 // The IP address or port number is invalid (e.g. = cannot connect to the IP 176 // address 0 or the port 0,. 177 CRONET_NET_ERROR_ADDRESS_INVALID = -108, 178 179 // The IP address is unreachable. This usually means that there is no route 180 // to 181 // the specified host or network. 182 CRONET_NET_ERROR_ADDRESS_UNREACHABLE = -109, 183 184 // The server requested a client certificate for SSL client authentication. 185 CRONET_NET_ERROR_SSL_CLIENT_AUTH_CERT_NEEDED = -110, 186 187 // A tunnel connection through the proxy could not be established. 188 CRONET_NET_ERROR_TUNNEL_CONNECTION_FAILED = -111, 189 190 // No SSL protocol versions are enabled. 191 CRONET_NET_ERROR_NO_SSL_VERSIONS_ENABLED = -112, 192 193 // The client and server don't support a common SSL protocol version or 194 // cipher suite. 195 CRONET_NET_ERROR_SSL_VERSION_OR_CIPHER_MISMATCH = -113, 196 197 // The server requested a renegotiation (rehandshake,. 198 CRONET_NET_ERROR_SSL_RENEGOTIATION_REQUESTED = -114, 199 200 // The proxy requested authentication (for tunnel establishment, with an 201 // unsupported method. 202 CRONET_NET_ERROR_PROXY_AUTH_UNSUPPORTED = -115, 203 204 // During SSL renegotiation (rehandshake, = the server sent a certificate with 205 // an error. 206 // 207 // Note: this error is not in the -2xx range so that it won't be handled as a 208 // certificate error. 209 CRONET_NET_ERROR_CERT_ERROR_IN_SSL_RENEGOTIATION = -116, 210 211 // The SSL handshake failed because of a bad or missing client certificate. 212 CRONET_NET_ERROR_BAD_SSL_CLIENT_AUTH_CERT = -117, 213 214 // A connection attempt timed out. 215 CRONET_NET_ERROR_CONNECTION_TIMED_OUT = -118, 216 217 // There are too many pending DNS resolves = so a request in the queue was 218 // aborted. 219 CRONET_NET_ERROR_HOST_RESOLVER_QUEUE_TOO_LARGE = -119, 220 221 // Failed establishing a connection to the SOCKS proxy server for a target 222 // host. 223 CRONET_NET_ERROR_SOCKS_CONNECTION_FAILED = -120, 224 225 // The SOCKS proxy server failed establishing connection to the target host 226 // because that host is unreachable. 227 CRONET_NET_ERROR_SOCKS_CONNECTION_HOST_UNREACHABLE = -121, 228 229 // The request to negotiate an alternate protocol failed. 230 CRONET_NET_ERROR_ALPN_NEGOTIATION_FAILED = -122, 231 232 // The peer sent an SSL no_renegotiation alert message. 233 CRONET_NET_ERROR_SSL_NO_RENEGOTIATION = -123, 234 235 // Winsock sometimes reports more data written than passed. This is probably 236 // due to a broken LSP. 237 CRONET_NET_ERROR_WINSOCK_UNEXPECTED_WRITTEN_BYTES = -124, 238 239 // An SSL peer sent us a fatal decompression_failure alert. This typically 240 // occurs when a peer selects DEFLATE compression in the mistaken belief that 241 // it supports it. 242 CRONET_NET_ERROR_SSL_DECOMPRESSION_FAILURE_ALERT = -125, 243 244 // An SSL peer sent us a fatal bad_record_mac alert. This has been observed 245 // from servers with buggy DEFLATE support. 246 CRONET_NET_ERROR_SSL_BAD_RECORD_MAC_ALERT = -126, 247 248 // The proxy requested authentication (for tunnel establishment,. 249 CRONET_NET_ERROR_PROXY_AUTH_REQUESTED = -127, 250 251 // Error -129 was removed (SSL_WEAK_SERVER_EPHEMERAL_DH_KEY,. 252 253 // Could not create a connection to the proxy server. An error occurred 254 // either in resolving its name = or in connecting a socket to it. 255 // Note that this does NOT include failures during the actual "CONNECT" method 256 // of an HTTP proxy. 257 CRONET_NET_ERROR_PROXY_CONNECTION_FAILED = -130, 258 259 // A mandatory proxy configuration could not be used. Currently this means 260 // that a mandatory PAC script could not be fetched = parsed or executed. 261 CRONET_NET_ERROR_MANDATORY_PROXY_CONFIGURATION_FAILED = -131, 262 263 // -132 was formerly ERR_ESET_ANTI_VIRUS_SSL_INTERCEPTION 264 265 // We've hit the max socket limit for the socket pool while preconnecting. We 266 // don't bother trying to preconnect more sockets. 267 CRONET_NET_ERROR_PRECONNECT_MAX_SOCKET_LIMIT = -133, 268 269 // The permission to use the SSL client certificate's private key was denied. 270 CRONET_NET_ERROR_SSL_CLIENT_AUTH_PRIVATE_KEY_ACCESS_DENIED = -134, 271 272 // The SSL client certificate has no private key. 273 CRONET_NET_ERROR_SSL_CLIENT_AUTH_CERT_NO_PRIVATE_KEY = -135, 274 275 // The certificate presented by the HTTPS Proxy was invalid. 276 CRONET_NET_ERROR_PROXY_CERTIFICATE_INVALID = -136, 277 278 // An error occurred when trying to do a name resolution (DNS,. 279 CRONET_NET_ERROR_NAME_RESOLUTION_FAILED = -137, 280 281 // Permission to access the network was denied. This is used to distinguish 282 // errors that were most likely caused by a firewall from other access denied 283 // errors. See also ERR_ACCESS_DENIED. 284 CRONET_NET_ERROR_NETWORK_ACCESS_DENIED = -138, 285 286 // The request throttler module cancelled this request to avoid DDOS. 287 CRONET_NET_ERROR_TEMPORARILY_THROTTLED = -139, 288 289 // A request to create an SSL tunnel connection through the HTTPS proxy 290 // received a 302 (temporary redirect, response. The response body might 291 // include a description of why the request failed. 292 // 293 // TODO(crbug.com/928551): This is deprecated and should not be used 294 // by new code. 295 CRONET_NET_ERROR_HTTPS_PROXY_TUNNEL_RESPONSE_REDIRECT = -140, 296 297 // We were unable to sign the CertificateVerify data of an SSL client auth 298 // handshake with the client certificate's private key. 299 // 300 // Possible causes for this include the user implicitly or explicitly 301 // denying access to the private key = the private key may not be valid for 302 // signing = the key may be relying on a cached handle which is no longer 303 // valid = or the CSP won't allow arbitrary data to be signed. 304 CRONET_NET_ERROR_SSL_CLIENT_AUTH_SIGNATURE_FAILED = -141, 305 306 // The message was too large for the transport. (for example a UDP message 307 // which exceeds size threshold,. 308 CRONET_NET_ERROR_MSG_TOO_BIG = -142, 309 310 // Error -143 was removed (SPDY_SESSION_ALREADY_EXISTS, 311 312 // Error -144 was removed (LIMIT_VIOLATION,. 313 314 // Websocket protocol error. Indicates that we are terminating the connection 315 // due to a malformed frame or other protocol violation. 316 CRONET_NET_ERROR_WS_PROTOCOL_ERROR = -145, 317 318 // Error -146 was removed (PROTOCOL_SWITCHED, 319 320 // Returned when attempting to bind an address that is already in use. 321 CRONET_NET_ERROR_ADDRESS_IN_USE = -147, 322 323 // An operation failed because the SSL handshake has not completed. 324 CRONET_NET_ERROR_SSL_HANDSHAKE_NOT_COMPLETED = -148, 325 326 // SSL peer's public key is invalid. 327 CRONET_NET_ERROR_SSL_BAD_PEER_PUBLIC_KEY = -149, 328 329 // The certificate didn't match the built-in public key pins for the host 330 // name. 331 // The pins are set in net/http/transport_security_state.cc and require that 332 // one of a set of public keys exist on the path from the leaf to the root. 333 CRONET_NET_ERROR_SSL_PINNED_KEY_NOT_IN_CERT_CHAIN = -150, 334 335 // Server request for client certificate did not contain any types we support. 336 CRONET_NET_ERROR_CLIENT_AUTH_CERT_TYPE_UNSUPPORTED = -151, 337 338 // Error -152 was removed (ORIGIN_BOUND_CERT_GENERATION_TYPE_MISMATCH, 339 340 // An SSL peer sent us a fatal decrypt_error alert. This typically occurs when 341 // a peer could not correctly verify a signature (in CertificateVerify or 342 // ServerKeyExchange, or validate a Finished message. 343 CRONET_NET_ERROR_SSL_DECRYPT_ERROR_ALERT = -153, 344 345 // There are too many pending WebSocketJob instances = so the new job was not 346 // pushed to the queue. 347 CRONET_NET_ERROR_WS_THROTTLE_QUEUE_TOO_LARGE = -154, 348 349 // Error -155 was removed (TOO_MANY_SOCKET_STREAMS, 350 351 // The SSL server certificate changed in a renegotiation. 352 CRONET_NET_ERROR_SSL_SERVER_CERT_CHANGED = -156, 353 354 // Error -157 was removed (SSL_INAPPROPRIATE_FALLBACK,. 355 356 // Error -158 was removed (CT_NO_SCTS_VERIFIED_OK,. 357 358 // The SSL server sent us a fatal unrecognized_name alert. 359 CRONET_NET_ERROR_SSL_UNRECOGNIZED_NAME_ALERT = -159, 360 361 // Failed to set the socket's receive buffer size as requested. 362 CRONET_NET_ERROR_SOCKET_SET_RECEIVE_BUFFER_SIZE_ERROR = -160, 363 364 // Failed to set the socket's send buffer size as requested. 365 CRONET_NET_ERROR_SOCKET_SET_SEND_BUFFER_SIZE_ERROR = -161, 366 367 // Failed to set the socket's receive buffer size as requested = despite 368 // success 369 // return code from setsockopt. 370 CRONET_NET_ERROR_SOCKET_RECEIVE_BUFFER_SIZE_UNCHANGEABLE = -162, 371 372 // Failed to set the socket's send buffer size as requested = despite success 373 // return code from setsockopt. 374 CRONET_NET_ERROR_SOCKET_SEND_BUFFER_SIZE_UNCHANGEABLE = -163, 375 376 // Failed to import a client certificate from the platform store into the SSL 377 // library. 378 CRONET_NET_ERROR_SSL_CLIENT_AUTH_CERT_BAD_FORMAT = -164, 379 380 // Error -165 was removed (SSL_FALLBACK_BEYOND_MINIMUM_VERSION,. 381 382 // Resolving a hostname to an IP address list included the IPv4 address 383 // "127.0.53.53". This is a special IP address which ICANN has recommended to 384 // indicate there was a name collision = and alert admins to a potential 385 // problem. 386 CRONET_NET_ERROR_ICANN_NAME_COLLISION = -166, 387 388 // The SSL server presented a certificate which could not be decoded. This is 389 // not a certificate error code as no X509Certificate object is available. 390 // This 391 // error is fatal. 392 CRONET_NET_ERROR_SSL_SERVER_CERT_BAD_FORMAT = -167, 393 394 // Certificate Transparency: Received a signed tree head that failed to parse. 395 CRONET_NET_ERROR_CT_STH_PARSING_FAILED = -168, 396 397 // Certificate Transparency: Received a signed tree head whose JSON parsing 398 // was 399 // OK but was missing some of the fields. 400 CRONET_NET_ERROR_CT_STH_INCOMPLETE = -169, 401 402 // The attempt to reuse a connection to send proxy auth credentials failed 403 // before the AuthController was used to generate credentials. The caller 404 // should 405 // reuse the controller with a new connection. This error is only used 406 // internally by the network stack. 407 CRONET_NET_ERROR_UNABLE_TO_REUSE_CONNECTION_FOR_PROXY_AUTH = -170, 408 409 // Certificate Transparency: Failed to parse the received consistency proof. 410 CRONET_NET_ERROR_CT_CONSISTENCY_PROOF_PARSING_FAILED = -171, 411 412 // The SSL server required an unsupported cipher suite that has since been 413 // removed. This error will temporarily be signaled on a fallback for one or 414 // two 415 // releases immediately following a cipher suite's removal = after which the 416 // fallback will be removed. 417 CRONET_NET_ERROR_SSL_OBSOLETE_CIPHER = -172, 418 419 // When a WebSocket handshake is done successfully and the connection has been 420 // upgraded = the URLRequest is cancelled with this error code. 421 CRONET_NET_ERROR_WS_UPGRADE = -173, 422 423 // Socket ReadIfReady support is not implemented. This error should not be 424 // user 425 // visible = because the normal Read(, method is used as a fallback. 426 CRONET_NET_ERROR_READ_IF_READY_NOT_IMPLEMENTED = -174, 427 428 // Error -175 was removed (SSL_VERSION_INTERFERENCE,. 429 430 // No socket buffer space is available. 431 CRONET_NET_ERROR_NO_BUFFER_SPACE = -176, 432 433 // There were no common signature algorithms between our client certificate 434 // private key and the server's preferences. 435 CRONET_NET_ERROR_SSL_CLIENT_AUTH_NO_COMMON_ALGORITHMS = -177, 436 437 // TLS 1.3 early data was rejected by the server. This will be received before 438 // any data is returned from the socket. The request should be retried with 439 // early data disabled. 440 CRONET_NET_ERROR_EARLY_DATA_REJECTED = -178, 441 442 // TLS 1.3 early data was offered = but the server responded with TLS 1.2 or 443 // earlier. This is an internal error code to account for a 444 // backwards-compatibility issue with early data and TLS 1.2. It will be 445 // received before any data is returned from the socket. The request should be 446 // retried with early data disabled. 447 // 448 // See https: //tools.ietf.org/html/rfc8446#appendix-D.3 for details. 449 CRONET_NET_ERROR_WRONG_VERSION_ON_EARLY_DATA = -179, 450 451 // TLS 1.3 was enabled = but a lower version was negotiated and the server 452 // returned a value indicating it supported TLS 1.3. This is part of a 453 // security 454 // check in TLS 1.3 = but it may also indicate the user is behind a buggy 455 // TLS-terminating proxy which implemented TLS 1.2 incorrectly. (See 456 // https: //crbug.com/boringssl/226., 457 CRONET_NET_ERROR_TLS13_DOWNGRADE_DETECTED = -180, 458 459 // The server's certificate has a keyUsage extension incompatible with the 460 // negotiated TLS key exchange method. 461 CRONET_NET_ERROR_SSL_KEY_USAGE_INCOMPATIBLE = -181, 462 463 // Certificate error codes 464 // 465 // The values of certificate error codes must be consecutive. 466 467 // The server responded with a certificate whose common name did not match 468 // the host name. This could mean: 469 // 470 // 1. An attacker has redirected our traffic to their server and is 471 // presenting a certificate for which they know the private key. 472 // 473 // 2. The server is misconfigured and responding with the wrong cert. 474 // 475 // 3. The user is on a wireless network and is being redirected to the 476 // network's login page. 477 // 478 // 4. The OS has used a DNS search suffix and the server doesn't have 479 // a certificate for the abbreviated name in the address bar. 480 // 481 CRONET_NET_ERROR_CERT_COMMON_NAME_INVALID = -200, 482 483 // The server responded with a certificate that = by our clock = appears to 484 // either not yet be valid or to have expired. This could mean: 485 // 486 // 1. An attacker is presenting an old certificate for which they have 487 // managed to obtain the private key. 488 // 489 // 2. The server is misconfigured and is not presenting a valid cert. 490 // 491 // 3. Our clock is wrong. 492 // 493 CRONET_NET_ERROR_CERT_DATE_INVALID = -201, 494 495 // The server responded with a certificate that is signed by an authority 496 // we don't trust. The could mean: 497 // 498 // 1. An attacker has substituted the real certificate for a cert that 499 // contains their public key and is signed by their cousin. 500 // 501 // 2. The server operator has a legitimate certificate from a CA we don't 502 // know about = but should trust. 503 // 504 // 3. The server is presenting a self-signed certificate = providing no 505 // defense against active attackers (but foiling passive attackers,. 506 // 507 CRONET_NET_ERROR_CERT_AUTHORITY_INVALID = -202, 508 509 // The server responded with a certificate that contains errors. 510 // This error is not recoverable. 511 // 512 // MSDN describes this error as follows: 513 // "The SSL certificate contains errors." 514 // NOTE: It's unclear how this differs from ERR_CERT_INVALID. For consistency 515 // = 516 // use that code instead of this one from now on. 517 // 518 CRONET_NET_ERROR_CERT_CONTAINS_ERRORS = -203, 519 520 // The certificate has no mechanism for determining if it is revoked. In 521 // effect = this certificate cannot be revoked. 522 CRONET_NET_ERROR_CERT_NO_REVOCATION_MECHANISM = -204, 523 524 // Revocation information for the security certificate for this site is not 525 // available. This could mean: 526 // 527 // 1. An attacker has compromised the private key in the certificate and is 528 // blocking our attempt to find out that the cert was revoked. 529 // 530 // 2. The certificate is unrevoked = but the revocation server is busy or 531 // unavailable. 532 // 533 CRONET_NET_ERROR_CERT_UNABLE_TO_CHECK_REVOCATION = -205, 534 535 // The server responded with a certificate has been revoked. 536 // We have the capability to ignore this error = but it is probably not the 537 // thing to do. 538 CRONET_NET_ERROR_CERT_REVOKED = -206, 539 540 // The server responded with a certificate that is invalid. 541 // This error is not recoverable. 542 // 543 // MSDN describes this error as follows: 544 // "The SSL certificate is invalid." 545 // 546 CRONET_NET_ERROR_CERT_INVALID = -207, 547 548 // The server responded with a certificate that is signed using a weak 549 // signature algorithm. 550 CRONET_NET_ERROR_CERT_WEAK_SIGNATURE_ALGORITHM = -208, 551 552 // -209 is available: was CERT_NOT_IN_DNS. 553 554 // The host name specified in the certificate is not unique. 555 CRONET_NET_ERROR_CERT_NON_UNIQUE_NAME = -210, 556 557 // The server responded with a certificate that contains a weak key (e.g. 558 // a too-small RSA key,. 559 CRONET_NET_ERROR_CERT_WEAK_KEY = -211, 560 561 // The certificate claimed DNS names that are in violation of name 562 // constraints. 563 CRONET_NET_ERROR_CERT_NAME_CONSTRAINT_VIOLATION = -212, 564 565 // The certificate's validity period is too long. 566 CRONET_NET_ERROR_CERT_VALIDITY_TOO_LONG = -213, 567 568 // Certificate Transparency was required for this connection = but the server 569 // did not provide CT information that complied with the policy. 570 CRONET_NET_ERROR_CERTIFICATE_TRANSPARENCY_REQUIRED = -214, 571 572 // The certificate chained to a legacy Symantec root that is no longer 573 // trusted. 574 // https: //g.co/chrome/symantecpkicerts 575 CRONET_NET_ERROR_CERT_SYMANTEC_LEGACY = -215, 576 577 // -216 was QUIC_CERT_ROOT_NOT_KNOWN which has been renumbered to not be in 578 // the 579 // certificate error range. 580 581 // The certificate is known to be used for interception by an entity other 582 // the device owner. 583 CRONET_NET_ERROR_CERT_KNOWN_INTERCEPTION_BLOCKED = -217, 584 585 // The connection uses an obsolete version of SSL/TLS. 586 CRONET_NET_ERROR_SSL_OBSOLETE_VERSION = -218, 587 588 // Add new certificate error codes here. 589 // 590 // Update the value of CERT_END whenever you add a new certificate error 591 // code. 592 593 // The value immediately past the last certificate error code. 594 CRONET_NET_ERROR_CERT_END = -219, 595 596 // The URL is invalid. 597 CRONET_NET_ERROR_INVALID_URL = -300, 598 599 // The scheme of the URL is disallowed. 600 CRONET_NET_ERROR_DISALLOWED_URL_SCHEME = -301, 601 602 // The scheme of the URL is unknown. 603 CRONET_NET_ERROR_UNKNOWN_URL_SCHEME = -302, 604 605 // Attempting to load an URL resulted in a redirect to an invalid URL. 606 CRONET_NET_ERROR_INVALID_REDIRECT = -303, 607 608 // Attempting to load an URL resulted in too many redirects. 609 CRONET_NET_ERROR_TOO_MANY_REDIRECTS = -310, 610 611 // Attempting to load an URL resulted in an unsafe redirect (e.g. = a redirect 612 // to file: // is considered unsafe,. 613 CRONET_NET_ERROR_UNSAFE_REDIRECT = -311, 614 615 // Attempting to load an URL with an unsafe port number. These are port 616 // numbers that correspond to services = which are not robust to spurious 617 // input 618 // that may be constructed as a result of an allowed web construct (e.g. = 619 // HTTP 620 // looks a lot like SMTP = so form submission to port 25 is denied,. 621 CRONET_NET_ERROR_UNSAFE_PORT = -312, 622 623 // The server's response was invalid. 624 CRONET_NET_ERROR_INVALID_RESPONSE = -320, 625 626 // Error in chunked transfer encoding. 627 CRONET_NET_ERROR_INVALID_CHUNKED_ENCODING = -321, 628 629 // The server did not support the request method. 630 CRONET_NET_ERROR_METHOD_NOT_SUPPORTED = -322, 631 632 // The response was 407 (Proxy Authentication Required, = yet we did not send 633 // the request to a proxy. 634 CRONET_NET_ERROR_UNEXPECTED_PROXY_AUTH = -323, 635 636 // The server closed the connection without sending any data. 637 CRONET_NET_ERROR_EMPTY_RESPONSE = -324, 638 639 // The headers section of the response is too large. 640 CRONET_NET_ERROR_RESPONSE_HEADERS_TOO_BIG = -325, 641 642 // Error -326 was removed (PAC_STATUS_NOT_OK, 643 644 // The evaluation of the PAC script failed. 645 CRONET_NET_ERROR_PAC_SCRIPT_FAILED = -327, 646 647 // The response was 416 (Requested range not satisfiable, and the server 648 // cannot 649 // satisfy the range requested. 650 CRONET_NET_ERROR_REQUEST_RANGE_NOT_SATISFIABLE = -328, 651 652 // The identity used for authentication is invalid. 653 CRONET_NET_ERROR_MALFORMED_IDENTITY = -329, 654 655 // Content decoding of the response body failed. 656 CRONET_NET_ERROR_CONTENT_DECODING_FAILED = -330, 657 658 // An operation could not be completed because all network IO 659 // is suspended. 660 CRONET_NET_ERROR_NETWORK_IO_SUSPENDED = -331, 661 662 // FLIP data received without receiving a SYN_REPLY on the stream. 663 CRONET_NET_ERROR_SYN_REPLY_NOT_RECEIVED = -332, 664 665 // Converting the response to target encoding failed. 666 CRONET_NET_ERROR_ENCODING_CONVERSION_FAILED = -333, 667 668 // The server sent an FTP directory listing in a format we do not understand. 669 CRONET_NET_ERROR_UNRECOGNIZED_FTP_DIRECTORY_LISTING_FORMAT = -334, 670 671 // Obsolete. Was only logged in NetLog when an HTTP/2 pushed stream expired. 672 // CRONET_NET_ERROR_INVALID_SPDY_STREAM = -335, 673 674 // There are no supported proxies in the provided list. 675 CRONET_NET_ERROR_NO_SUPPORTED_PROXIES = -336, 676 677 // There is an HTTP/2 protocol error. 678 CRONET_NET_ERROR_HTTP2_PROTOCOL_ERROR = -337, 679 680 // Credentials could not be established during HTTP Authentication. 681 CRONET_NET_ERROR_INVALID_AUTH_CREDENTIALS = -338, 682 683 // An HTTP Authentication scheme was tried which is not supported on this 684 // machine. 685 CRONET_NET_ERROR_UNSUPPORTED_AUTH_SCHEME = -339, 686 687 // Detecting the encoding of the response failed. 688 CRONET_NET_ERROR_ENCODING_DETECTION_FAILED = -340, 689 690 // (GSSAPI, No Kerberos credentials were available during HTTP Authentication. 691 CRONET_NET_ERROR_MISSING_AUTH_CREDENTIALS = -341, 692 693 // An unexpected = but documented = SSPI or GSSAPI status code was returned. 694 CRONET_NET_ERROR_UNEXPECTED_SECURITY_LIBRARY_STATUS = -342, 695 696 // The environment was not set up correctly for authentication (for 697 // example = no KDC could be found or the principal is unknown. 698 CRONET_NET_ERROR_MISCONFIGURED_AUTH_ENVIRONMENT = -343, 699 700 // An undocumented SSPI or GSSAPI status code was returned. 701 CRONET_NET_ERROR_UNDOCUMENTED_SECURITY_LIBRARY_STATUS = -344, 702 703 // The HTTP response was too big to drain. 704 CRONET_NET_ERROR_RESPONSE_BODY_TOO_BIG_TO_DRAIN = -345, 705 706 // The HTTP response contained multiple distinct Content-Length headers. 707 CRONET_NET_ERROR_RESPONSE_HEADERS_MULTIPLE_CONTENT_LENGTH = -346, 708 709 // HTTP/2 headers have been received = but not all of them - status or version 710 // headers are missing = so we're expecting additional frames to complete 711 // them. 712 CRONET_NET_ERROR_INCOMPLETE_HTTP2_HEADERS = -347, 713 714 // No PAC URL configuration could be retrieved from DHCP. This can indicate 715 // either a failure to retrieve the DHCP configuration = or that there was no 716 // PAC URL configured in DHCP. 717 CRONET_NET_ERROR_PAC_NOT_IN_DHCP = -348, 718 719 // The HTTP response contained multiple Content-Disposition headers. 720 CRONET_NET_ERROR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION = -349, 721 722 // The HTTP response contained multiple Location headers. 723 CRONET_NET_ERROR_RESPONSE_HEADERS_MULTIPLE_LOCATION = -350, 724 725 // HTTP/2 server refused the request without processing = and sent either a 726 // GOAWAY frame with error code NO_ERROR and Last-Stream-ID lower than the 727 // stream id corresponding to the request indicating that this request has not 728 // been processed yet = or a RST_STREAM frame with error code REFUSED_STREAM. 729 // Client MAY retry (on a different connection,. See RFC7540 Section 8.1.4. 730 CRONET_NET_ERROR_HTTP2_SERVER_REFUSED_STREAM = -351, 731 732 // HTTP/2 server didn't respond to the PING message. 733 CRONET_NET_ERROR_HTTP2_PING_FAILED = -352, 734 735 // Obsolete. Kept here to avoid reuse = as the old error can still appear on 736 // histograms. 737 // CRONET_NET_ERROR_PIPELINE_EVICTION = -353, 738 739 // The HTTP response body transferred fewer bytes than were advertised by the 740 // Content-Length header when the connection is closed. 741 CRONET_NET_ERROR_CONTENT_LENGTH_MISMATCH = -354, 742 743 // The HTTP response body is transferred with Chunked-Encoding = but the 744 // terminating zero-length chunk was never sent when the connection is closed. 745 CRONET_NET_ERROR_INCOMPLETE_CHUNKED_ENCODING = -355, 746 747 // There is a QUIC protocol error. 748 CRONET_NET_ERROR_QUIC_PROTOCOL_ERROR = -356, 749 750 // The HTTP headers were truncated by an EOF. 751 CRONET_NET_ERROR_RESPONSE_HEADERS_TRUNCATED = -357, 752 753 // The QUIC crypto handshake failed. This means that the server was unable 754 // to read any requests sent = so they may be resent. 755 CRONET_NET_ERROR_QUIC_HANDSHAKE_FAILED = -358, 756 757 // Obsolete. Kept here to avoid reuse = as the old error can still appear on 758 // histograms. 759 // CRONET_NET_ERROR_REQUEST_FOR_SECURE_RESOURCE_OVER_INSECURE_QUIC = -359, 760 761 // Transport security is inadequate for the HTTP/2 version. 762 CRONET_NET_ERROR_HTTP2_INADEQUATE_TRANSPORT_SECURITY = -360, 763 764 // The peer violated HTTP/2 flow control. 765 CRONET_NET_ERROR_HTTP2_FLOW_CONTROL_ERROR = -361, 766 767 // The peer sent an improperly sized HTTP/2 frame. 768 CRONET_NET_ERROR_HTTP2_FRAME_SIZE_ERROR = -362, 769 770 // Decoding or encoding of compressed HTTP/2 headers failed. 771 CRONET_NET_ERROR_HTTP2_COMPRESSION_ERROR = -363, 772 773 // Proxy Auth Requested without a valid Client Socket Handle. 774 CRONET_NET_ERROR_PROXY_AUTH_REQUESTED_WITH_NO_CONNECTION = -364, 775 776 // HTTP_1_1_REQUIRED error code received on HTTP/2 session. 777 CRONET_NET_ERROR_HTTP_1_1_REQUIRED = -365, 778 779 // HTTP_1_1_REQUIRED error code received on HTTP/2 session to proxy. 780 CRONET_NET_ERROR_PROXY_HTTP_1_1_REQUIRED = -366, 781 782 // The PAC script terminated fatally and must be reloaded. 783 CRONET_NET_ERROR_PAC_SCRIPT_TERMINATED = -367, 784 785 // Obsolete. Kept here to avoid reuse. 786 // Request is throttled because of a Backoff header. 787 // See: crbug.com/486891. 788 // CRONET_NET_ERROR_TEMPORARY_BACKOFF = -369, 789 790 // The server was expected to return an HTTP/1.x response = but did not. 791 // Rather 792 // than treat it as HTTP/0.9 = this error is returned. 793 CRONET_NET_ERROR_INVALID_HTTP_RESPONSE = -370, 794 795 // Initializing content decoding failed. 796 CRONET_NET_ERROR_CONTENT_DECODING_INIT_FAILED = -371, 797 798 // Received HTTP/2 RST_STREAM frame with NO_ERROR error code. This error 799 // should 800 // be handled internally by HTTP/2 code = and should not make it above the 801 // SpdyStream layer. 802 CRONET_NET_ERROR_HTTP2_RST_STREAM_NO_ERROR_RECEIVED = -372, 803 804 // The pushed stream claimed by the request is no longer available. 805 CRONET_NET_ERROR_HTTP2_PUSHED_STREAM_NOT_AVAILABLE = -373, 806 807 // A pushed stream was claimed and later reset by the server. When this 808 // happens = 809 // the request should be retried. 810 CRONET_NET_ERROR_HTTP2_CLAIMED_PUSHED_STREAM_RESET_BY_SERVER = -374, 811 812 // An HTTP transaction was retried too many times due for authentication or 813 // invalid certificates. This may be due to a bug in the net stack that would 814 // otherwise infinite loop = or if the server or proxy continually requests 815 // fresh 816 // credentials or presents a fresh invalid certificate. 817 CRONET_NET_ERROR_TOO_MANY_RETRIES = -375, 818 819 // Received an HTTP/2 frame on a closed stream. 820 CRONET_NET_ERROR_HTTP2_STREAM_CLOSED = -376, 821 822 // Client is refusing an HTTP/2 stream. 823 CRONET_NET_ERROR_HTTP2_CLIENT_REFUSED_STREAM = -377, 824 825 // A pushed HTTP/2 stream was claimed by a request based on matching URL and 826 // request headers = but the pushed response headers do not match the request. 827 CRONET_NET_ERROR_HTTP2_PUSHED_RESPONSE_DOES_NOT_MATCH = -378, 828 829 // The server returned a non-2xx HTTP response code. 830 // 831 // Not that this error is only used by certain APIs that interpret the HTTP 832 // response itself. URLRequest for instance just passes most non-2xx 833 // response back as success. 834 CRONET_NET_ERROR_HTTP_RESPONSE_CODE_FAILURE = -379, 835 836 // The certificate presented on a QUIC connection does not chain to a known 837 // root 838 // and the origin connected to is not on a list of domains where unknown roots 839 // are allowed. 840 CRONET_NET_ERROR_QUIC_CERT_ROOT_NOT_KNOWN = -380, 841 842 // The cache does not have the requested entry. 843 CRONET_NET_ERROR_CACHE_MISS = -400, 844 845 // Unable to read from the disk cache. 846 CRONET_NET_ERROR_CACHE_READ_FAILURE = -401, 847 848 // Unable to write to the disk cache. 849 CRONET_NET_ERROR_CACHE_WRITE_FAILURE = -402, 850 851 // The operation is not supported for this entry. 852 CRONET_NET_ERROR_CACHE_OPERATION_NOT_SUPPORTED = -403, 853 854 // The disk cache is unable to open this entry. 855 CRONET_NET_ERROR_CACHE_OPEN_FAILURE = -404, 856 857 // The disk cache is unable to create this entry. 858 CRONET_NET_ERROR_CACHE_CREATE_FAILURE = -405, 859 860 // Multiple transactions are racing to create disk cache entries. This is an 861 // internal error returned from the HttpCache to the HttpCacheTransaction that 862 // tells the transaction to restart the entry-creation logic because the state 863 // of the cache has changed. 864 CRONET_NET_ERROR_CACHE_RACE = -406, 865 866 // The cache was unable to read a checksum record on an entry. This can be 867 // returned from attempts to read from the cache. It is an internal error = 868 // returned by the SimpleCache backend = but not by any URLRequest methods 869 // or members. 870 CRONET_NET_ERROR_CACHE_CHECKSUM_READ_FAILURE = -407, 871 872 // The cache found an entry with an invalid checksum. This can be returned 873 // from 874 // attempts to read from the cache. It is an internal error = returned by the 875 // SimpleCache backend = but not by any URLRequest methods or members. 876 CRONET_NET_ERROR_CACHE_CHECKSUM_MISMATCH = -408, 877 878 // Internal error code for the HTTP cache. The cache lock timeout has fired. 879 CRONET_NET_ERROR_CACHE_LOCK_TIMEOUT = -409, 880 881 // Received a challenge after the transaction has read some data = and the 882 // credentials aren't available. There isn't a way to get them at that point. 883 CRONET_NET_ERROR_CACHE_AUTH_FAILURE_AFTER_READ = -410, 884 885 // Internal not-quite error code for the HTTP cache. In-memory hints suggest 886 // that the cache entry would not have been useable with the transaction's 887 // current configuration (e.g. load flags = mode = etc., 888 CRONET_NET_ERROR_CACHE_ENTRY_NOT_SUITABLE = -411, 889 890 // The disk cache is unable to doom this entry. 891 CRONET_NET_ERROR_CACHE_DOOM_FAILURE = -412, 892 893 // The disk cache is unable to open or create this entry. 894 CRONET_NET_ERROR_CACHE_OPEN_OR_CREATE_FAILURE = -413, 895 896 // The server's response was insecure (e.g. there was a cert error,. 897 CRONET_NET_ERROR_INSECURE_RESPONSE = -501, 898 899 // An attempt to import a client certificate failed = as the user's key 900 // database lacked a corresponding private key. 901 CRONET_NET_ERROR_NO_PRIVATE_KEY_FOR_CERT = -502, 902 903 // An error adding a certificate to the OS certificate database. 904 CRONET_NET_ERROR_ADD_USER_CERT_FAILED = -503, 905 906 // An error occurred while handling a signed exchange. 907 CRONET_NET_ERROR_INVALID_SIGNED_EXCHANGE = -504, 908 909 // An error occurred while handling a Web Bundle source. 910 CRONET_NET_ERROR_INVALID_WEB_BUNDLE = -505, 911 912 // A Trust Tokens protocol operation-executing request failed for one of a 913 // number of reasons (precondition failure = internal error = bad response,. 914 CRONET_NET_ERROR_TRUST_TOKEN_OPERATION_FAILED = -506, 915 916 // When handling a Trust Tokens protocol operation-executing request = the 917 // system 918 // found that the request's desired Trust Tokens results were already present 919 // in 920 // a local cache; as a result = the main request was cancelled. 921 CRONET_NET_ERROR_TRUST_TOKEN_OPERATION_CACHE_HIT = -507, 922 923 // *** Code -600 is reserved (was FTP_PASV_COMMAND_FAILED,. *** 924 925 // A generic error for failed FTP control connection command. 926 // If possible = please use or add a more specific error code. 927 CRONET_NET_ERROR_FTP_FAILED = -601, 928 929 // The server cannot fulfill the request at this point. This is a temporary 930 // error. 931 // FTP response code 421. 932 CRONET_NET_ERROR_FTP_SERVICE_UNAVAILABLE = -602, 933 934 // The server has aborted the transfer. 935 // FTP response code 426. 936 CRONET_NET_ERROR_FTP_TRANSFER_ABORTED = -603, 937 938 // The file is busy = or some other temporary error condition on opening 939 // the file. 940 // FTP response code 450. 941 CRONET_NET_ERROR_FTP_FILE_BUSY = -604, 942 943 // Server rejected our command because of syntax errors. 944 // FTP response codes 500 = 501. 945 CRONET_NET_ERROR_FTP_SYNTAX_ERROR = -605, 946 947 // Server does not support the command we issued. 948 // FTP response codes 502 = 504. 949 CRONET_NET_ERROR_FTP_COMMAND_NOT_SUPPORTED = -606, 950 951 // Server rejected our command because we didn't issue the commands in right 952 // order. 953 // FTP response code 503. 954 CRONET_NET_ERROR_FTP_BAD_COMMAND_SEQUENCE = -607, 955 956 // PKCS #12 import failed due to incorrect password. 957 CRONET_NET_ERROR_PKCS12_IMPORT_BAD_PASSWORD = -701, 958 959 // PKCS #12 import failed due to other error. 960 CRONET_NET_ERROR_PKCS12_IMPORT_FAILED = -702, 961 962 // CA import failed - not a CA cert. 963 CRONET_NET_ERROR_IMPORT_CA_CERT_NOT_CA = -703, 964 965 // Import failed - certificate already exists in database. 966 // Note it's a little weird this is an error but reimporting a PKCS12 is ok 967 // (no-op,. That's how Mozilla does it = though. 968 CRONET_NET_ERROR_IMPORT_CERT_ALREADY_EXISTS = -704, 969 970 // CA import failed due to some other error. 971 CRONET_NET_ERROR_IMPORT_CA_CERT_FAILED = -705, 972 973 // Server certificate import failed due to some internal error. 974 CRONET_NET_ERROR_IMPORT_SERVER_CERT_FAILED = -706, 975 976 // PKCS #12 import failed due to invalid MAC. 977 CRONET_NET_ERROR_PKCS12_IMPORT_INVALID_MAC = -707, 978 979 // PKCS #12 import failed due to invalid/corrupt file. 980 CRONET_NET_ERROR_PKCS12_IMPORT_INVALID_FILE = -708, 981 982 // PKCS #12 import failed due to unsupported features. 983 CRONET_NET_ERROR_PKCS12_IMPORT_UNSUPPORTED = -709, 984 985 // Key generation failed. 986 CRONET_NET_ERROR_KEY_GENERATION_FAILED = -710, 987 988 // Error -711 was removed (ORIGIN_BOUND_CERT_GENERATION_FAILED, 989 990 // Failure to export private key. 991 CRONET_NET_ERROR_PRIVATE_KEY_EXPORT_FAILED = -712, 992 993 // Self-signed certificate generation failed. 994 CRONET_NET_ERROR_SELF_SIGNED_CERT_GENERATION_FAILED = -713, 995 996 // The certificate database changed in some way. 997 CRONET_NET_ERROR_CERT_DATABASE_CHANGED = -714, 998 999 // Error -715 was removed (CHANNEL_ID_IMPORT_FAILED, 1000 1001 // DNS error codes. 1002 1003 // DNS resolver received a malformed response. 1004 CRONET_NET_ERROR_DNS_MALFORMED_RESPONSE = -800, 1005 1006 // DNS server requires TCP 1007 CRONET_NET_ERROR_DNS_SERVER_REQUIRES_TCP = -801, 1008 1009 // DNS server failed. This error is returned for all of the following 1010 // error conditions: 1011 // 1 - Format error - The name server was unable to interpret the query. 1012 // 2 - Server failure - The name server was unable to process this query 1013 // due to a problem with the name server. 1014 // 4 - Not Implemented - The name server does not support the requested 1015 // kind of query. 1016 // 5 - Refused - The name server refuses to perform the specified 1017 // operation for policy reasons. 1018 CRONET_NET_ERROR_DNS_SERVER_FAILED = -802, 1019 1020 // DNS transaction timed out. 1021 CRONET_NET_ERROR_DNS_TIMED_OUT = -803, 1022 1023 // The entry was not found in cache or other local sources = for lookups where 1024 // only local sources were queried. 1025 CRONET_NET_ERROR_DNS_CACHE_MISS = -804, 1026 1027 // Suffix search list rules prevent resolution of the given host name. 1028 CRONET_NET_ERROR_DNS_SEARCH_EMPTY = -805, 1029 1030 // Failed to sort addresses according to RFC3484. 1031 CRONET_NET_ERROR_DNS_SORT_ERROR = -806, 1032 1033 // Error -807 was removed (DNS_HTTP_FAILED, 1034 1035 // Failed to resolve the hostname of a DNS-over-HTTPS server. 1036 CRONET_NET_ERROR_DNS_SECURE_RESOLVER_HOSTNAME_RESOLUTION_FAILED = -808, 1037 }; 1038 1039 const char* cronet_net_error_as_string(cronet_net_error_code net_error); 1040 1041 #endif /* GRPC_CORE_EXT_TRANSPORT_CRONET_TRANSPORT_CRONET_STATUS_H */ 1042