| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent bd07ad2 commit 00688b6
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1714,6 +1714,12 @@ recommended to use 2048 bits or larger for stronger security. | |||
| 1714 | 1714 | A TLS/SSL handshake timed out. In this case, the server must also abort the | |
| 1715 | 1715 | connection. | |
| 1716 | 1716 | ||
| 1717 | + <a id="ERR_TLS_INVALID_PROTOCOL_METHOD"></a> | ||
| 1718 | + ### ERR_TLS_INVALID_PROTOCOL_METHOD | ||
| 1719 | + | ||
| 1720 | + The specified `secureProtocol` method is invalid. It is either unknown, or | ||
| 1721 | + disabled because it is insecure. | ||
| 1722 | + | ||
| 1717 | 1723 | <a id="ERR_TLS_INVALID_PROTOCOL_VERSION"></a> | |
| 1718 | 1724 | ### ERR_TLS_INVALID_PROTOCOL_VERSION | |
| 1719 | 1725 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -65,6 +65,8 @@ static const int X509_NAME_FLAGS = ASN1_STRFLGS_ESC_CTRL | |||
| 65 | 65 | namespace node { | |
| 66 | 66 | namespace crypto { | |
| 67 | 67 | ||
| 68 | + using node::THROW_ERR_TLS_INVALID_PROTOCOL_METHOD; | ||
| 69 | + | ||
| 68 | 70 | using v8::Array; | |
| 69 | 71 | using v8::ArrayBufferView; | |
| 70 | 72 | using v8::Boolean; | |
@@ -424,17 +426,23 @@ void SecureContext::Init(const FunctionCallbackInfo<Value>& args) { | |||
| 424 | 426 | // protocols are supported unless explicitly disabled (which we do below | |
| 425 | 427 | // for SSLv2 and SSLv3.) | |
| 426 | 428 | if (strcmp(*sslmethod, "SSLv2_method") == 0) { | |
| 427 | - return env->ThrowError("SSLv2 methods disabled"); | ||
| 429 | + THROW_ERR_TLS_INVALID_PROTOCOL_METHOD(env, "SSLv2 methods disabled"); | ||
| 430 | + return; | ||
| 428 | 431 | } else if (strcmp(*sslmethod, "SSLv2_server_method") == 0) { | |
| 429 | - return env->ThrowError("SSLv2 methods disabled"); | ||
| 432 | + THROW_ERR_TLS_INVALID_PROTOCOL_METHOD(env, "SSLv2 methods disabled"); | ||
| 433 | + return; | ||
| 430 | 434 | } else if (strcmp(*sslmethod, "SSLv2_client_method") == 0) { | |
| 431 | - return env->ThrowError("SSLv2 methods disabled"); | ||
| 435 | + THROW_ERR_TLS_INVALID_PROTOCOL_METHOD(env, "SSLv2 methods disabled"); | ||
| 436 | + return; | ||
| 432 | 437 | } else if (strcmp(*sslmethod, "SSLv3_method") == 0) { | |
| 433 | - return env->ThrowError("SSLv3 methods disabled"); | ||
| 438 | + THROW_ERR_TLS_INVALID_PROTOCOL_METHOD(env, "SSLv3 methods disabled"); | ||
| 439 | + return; | ||
| 434 | 440 | } else if (strcmp(*sslmethod, "SSLv3_server_method") == 0) { | |
| 435 | - return env->ThrowError("SSLv3 methods disabled"); | ||
| 441 | + THROW_ERR_TLS_INVALID_PROTOCOL_METHOD(env, "SSLv3 methods disabled"); | ||
| 442 | + return; | ||
| 436 | 443 | } else if (strcmp(*sslmethod, "SSLv3_client_method") == 0) { | |
| 437 | - return env->ThrowError("SSLv3 methods disabled"); | ||
| 444 | + THROW_ERR_TLS_INVALID_PROTOCOL_METHOD(env, "SSLv3 methods disabled"); | ||
| 445 | + return; | ||
| 438 | 446 | } else if (strcmp(*sslmethod, "SSLv23_method") == 0) { | |
| 439 | 447 | // noop | |
| 440 | 448 | } else if (strcmp(*sslmethod, "SSLv23_server_method") == 0) { | |
@@ -478,7 +486,8 @@ void SecureContext::Init(const FunctionCallbackInfo<Value>& args) { | |||
| 478 | 486 | max_version = TLS1_2_VERSION; | |
| 479 | 487 | method = TLS_client_method(); | |
| 480 | 488 | } else { | |
| 481 | - return env->ThrowError("Unknown method"); | ||
| 489 | + THROW_ERR_TLS_INVALID_PROTOCOL_METHOD(env, "Unknown method"); | ||
| 490 | + return; | ||
| 482 | 491 | } | |
| 483 | 492 | } | |
| 484 | 493 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -55,6 +55,7 @@ void FatalException(v8::Isolate* isolate, | |||
| 55 | 55 | V(ERR_SCRIPT_EXECUTION_INTERRUPTED, Error) \ | |
| 56 | 56 | V(ERR_SCRIPT_EXECUTION_TIMEOUT, Error) \ | |
| 57 | 57 | V(ERR_STRING_TOO_LONG, Error) \ | |
| 58 | + V(ERR_TLS_INVALID_PROTOCOL_METHOD, TypeError) \ | ||
| 58 | 59 | V(ERR_TRANSFERRING_EXTERNALIZED_SHAREDARRAYBUFFER, TypeError) \ | |
| 59 | 60 | ||
| 60 | 61 | #define V(code, type) \ | |
| Back | FazBrowse Home | New Git URL |
0 commit comments