-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Implements Node.js behaviour for parallel/test-tls-set-ciphers-error.js #19443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 14 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
727f352
add test + passing
alii ae271bb
unnecessary prop
alii 4078a62
simpler
alii d69631f
address SecureContext change
alii c980b06
Merge branch 'main' into ali/test-tls-set-ciphers-error
alii 069797f
experiment: fix instanceof called on an object with an invalid protot…
alii 05944aa
Merge branch 'main' into ali/test-tls-set-ciphers-error
alii ed7c7f8
Merge branch 'main' into ali/test-tls-set-ciphers-error
alii bbd8ddb
more reasonable typecast for the quirk
alii eed875c
add type overrides
alii c37638a
create ERR_SSL_NO_CIPHER_MATCH
alii 4c591c3
more coverage for error codes
alii e85fdf5
Merge branch 'main' into ali/test-tls-set-ciphers-error
alii 2734d49
Merge branch 'main' into ali/test-tls-set-ciphers-error
alii e4ab7af
Merge branch 'main' of github.com:oven-sh/bun into ali/test-tls-set-c…
alii 9a16de9
add fix for test-tls-handshake-error.js
alii db31f60
`bun run prettier`
alii a95c424
console log
alii 7a51242
Merge branch 'ali/test-tls-set-ciphers-error' of github.com:oven-sh/b…
alii 124cfb3
remove import
alii a4fdefe
add another test file !!
alii 2a16907
Merge branch 'main' into ali/test-tls-set-ciphers-error
alii b2cc0d5
`bun run prettier`
alii File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| 'use strict'; | ||
| const common = require('../common'); | ||
|
|
||
| if (!common.hasCrypto) | ||
| common.skip('missing crypto'); | ||
|
|
||
| const assert = require('assert'); | ||
| const tls = require('tls'); | ||
| const fixtures = require('../common/fixtures'); | ||
|
|
||
| { | ||
| const options = { | ||
| key: fixtures.readKey('agent2-key.pem'), | ||
| cert: fixtures.readKey('agent2-cert.pem'), | ||
| ciphers: 'aes256-sha' | ||
| }; | ||
| assert.throws(() => tls.createServer(options, common.mustNotCall()), | ||
| /no[_ ]cipher[_ ]match/i); | ||
| options.ciphers = 'FOOBARBAZ'; | ||
| assert.throws(() => tls.createServer(options, common.mustNotCall()), | ||
| /no[_ ]cipher[_ ]match/i); | ||
| options.ciphers = 'TLS_not_a_cipher'; | ||
| assert.throws(() => tls.createServer(options, common.mustNotCall()), | ||
| /no[_ ]cipher[_ ]match/i); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| import { describe, expect, test } from "bun:test"; | ||
| import * as tls from "node:tls"; | ||
|
|
||
| const fixtures = require("../test/common/fixtures"); | ||
|
|
||
| describe("TLS No Cipher Match Error code matches Node.js", () => { | ||
| test("The error should have all the same properties as Node.js", () => { | ||
| const options = { | ||
| key: fixtures.readKey("agent2-key.pem"), | ||
| cert: fixtures.readKey("agent2-cert.pem"), | ||
| ciphers: "aes256-sha", | ||
| }; | ||
|
|
||
| expect(() => | ||
| tls.createServer(options, () => { | ||
| throw new Error("should not be called"); | ||
| }), | ||
| ).toThrow({ | ||
| code: "ERR_SSL_NO_CIPHER_MATCH", | ||
| message: "No cipher match", | ||
| library: "SSL routines", | ||
| reason: "no cipher match", | ||
| }); | ||
|
|
||
| options.ciphers = "FOOBARBAZ"; | ||
| expect(() => | ||
| tls.createServer(options, () => { | ||
| throw new Error("should not be called"); | ||
| }), | ||
| ).toThrow({ | ||
| code: "ERR_SSL_NO_CIPHER_MATCH", | ||
| message: "No cipher match", | ||
| library: "SSL routines", | ||
| reason: "no cipher match", | ||
| }); | ||
|
|
||
| options.ciphers = "TLS_not_a_cipher"; | ||
| expect(() => | ||
| tls.createServer(options, () => { | ||
| throw new Error("should not be called"); | ||
| }), | ||
| ).toThrow({ | ||
| code: "ERR_SSL_NO_CIPHER_MATCH", | ||
| message: "No cipher match", | ||
| library: "SSL routines", | ||
| reason: "no cipher match", | ||
| }); | ||
| }); | ||
| }); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in node the code is
error:0A0000B9:SSL routines::no cipher match. how much do we care about retaining the boringssl message?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Jarred-Sumner Any thoughts?