diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/parallel/test-tls-basic-validations.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/parallel/test-tls-basic-validations.js b/test/parallel/test-tls-basic-validations.js index d0082edb463..8d39b8d45c9 100644 --- a/test/parallel/test-tls-basic-validations.js +++ b/test/parallel/test-tls-basic-validations.js @@ -102,3 +102,16 @@ common.expectsError( assert(out.ALPNProtocols.equals(Buffer.from(expectView))); } } + +{ + const protocols = [(new String('a')).repeat(500)]; + const out = {}; + common.expectsError( + () => tls.convertALPNProtocols(protocols, out), + { + code: 'ERR_OUT_OF_RANGE', + message: 'The byte length of the protocol at index 0 exceeds the ' + + 'maximum length. It must be <= 255. Received 500' + } + ); +} |