GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Generate more certs/identities, and use them for better multi-cert test coverage by sam-github · Pull Request #10747 · nodejs/node

Conversation

@sam-github

@sam-github sam-github commented Jan 11, 2017

Copy link
Copy Markdown
Contributor
  • test: cover tls multi-identity option mixtures
  • test: confirm tls server suite default is its own
  • test: add independent multi-alg crypto identities
  • test: rename agent1-pfx.pem to agent1.pfx
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

tls

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@nodejs-github-bot nodejs-github-bot added test Issues and PRs related to Node.js core tests and test infrastructure. dont-land-on-v7.x labels Jan 11, 2017
@sam-github
sam-github force-pushed the generate-more-certs branch from 22660fb to 616ba33 Compare January 11, 2017 22:48
@nodejs-github-bot nodejs-github-bot added the dont-land-on-v7.x label Jan 11, 2017
@sam-github

sam-github commented Jan 11, 2017

Copy link
Copy Markdown
Contributor Author

Will rebase onto #10389 once it lands.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mscdex mscdex added tls Issues and PRs related to the tls subsystem. and removed dont-land-on-v7.x labels Jan 11, 2017
@sam-github
sam-github force-pushed the generate-more-certs branch from 616ba33 to 9358f42 Compare January 12, 2017 19:16
@nodejs-github-bot nodejs-github-bot added the dont-land-on-v7.x label Jan 12, 2017
@sam-github

sam-github commented Jan 12, 2017

Copy link
Copy Markdown
Contributor Author

Rebased onto #10771 so that tests can pass. Will rebase again once #10771 merges.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sam-github
sam-github force-pushed the generate-more-certs branch from 9358f42 to 750bb7b Compare January 12, 2017 20:02
@nodejs-github-bot nodejs-github-bot added the dont-land-on-v7.x label Jan 12, 2017
@sam-github

sam-github commented Jan 12, 2017

Copy link
Copy Markdown
Contributor Author

@nodejs/crypto

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sam-github
sam-github force-pushed the generate-more-certs branch from 750bb7b to 9f585b4 Compare January 13, 2017 19:46
@nodejs-github-bot nodejs-github-bot added the dont-land-on-v7.x label Jan 13, 2017
@sam-github

sam-github commented Jan 19, 2017 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

@shigeki @indutny @nodejs/crypto

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bnoordhuis
bnoordhuis requested changes Jan 20, 2017
View reviewed changes

@bnoordhuis bnoordhuis left a comment

Copy link
Copy Markdown
Member

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.

Are ca3, ca4 and ca6 used anywhere?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread test/fixtures/keys/Makefile Outdated

@bnoordhuis bnoordhuis Jan 20, 2017

Copy link
Copy Markdown
Member

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.

Target should be .PHONY.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread test/fixtures/keys/Makefile Outdated

@bnoordhuis bnoordhuis Jan 20, 2017

Copy link
Copy Markdown
Member

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.

You could make the recipes a little more DRY by using $@, $< and $^ more.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread test/fixtures/keys/ca4.cnf Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread test/fixtures/keys/ca5.cnf Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread test/fixtures/keys/ca6.cnf Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread test/parallel/test-tls-honorcipherorder.js Outdated

@bnoordhuis bnoordhuis Jan 20, 2017

Copy link
Copy Markdown
Member

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.

Can you use util.format here? Saves the casual reader from having to look up what fmt() is.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread test/parallel/test-tls-honorcipherorder.js Outdated

@bnoordhuis bnoordhuis Jan 20, 2017

Copy link
Copy Markdown
Member

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.

Stylistic change.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@targos targos removed the dont-land-on-v7.x label Jan 28, 2017
@sam-github sam-github mentioned this pull request Feb 13, 2017
doc: clarify tls.createServer's {cert, ca} #7230
Closed
2 tasks done
@sam-github
sam-github force-pushed the generate-more-certs branch from ea714d5 to fefefcb Compare February 14, 2017 17:00
@silverwind

silverwind commented Feb 14, 2017

Copy link
Copy Markdown
Contributor

Are there any matching cert + intermediate + key files in here? Asking so I can test #7230 (comment).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sam-github

sam-github commented Feb 14, 2017

Copy link
Copy Markdown
Contributor Author

@silverwind 5c700f9

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sam-github

sam-github commented Feb 14, 2017

Copy link
Copy Markdown
Contributor Author

@silverwind bf43a60a383fa5fce1051532c4e499c4b1df4c07 has the tests you are looking for, I believe, but this PR is partially broken at the moment, I am in process of rebasing (master had an agent8 and agent9 added to it, so I need to move my numbered certs forward, which I'm in process of doing right now).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sam-github
sam-github force-pushed the generate-more-certs branch from fefefcb to b979858 Compare February 14, 2017 17:15
@silverwind

silverwind commented Feb 14, 2017 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Hmm, can't find a fitting case there, but this should be a failing example:

cert: [agent10-cert, ca4-cert]
key: agent10-key
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sam-github
sam-github force-pushed the generate-more-certs branch from b979858 to d125ee8 Compare February 14, 2017 17:28
@sam-github

sam-github commented Feb 14, 2017

Copy link
Copy Markdown
Contributor Author

@silverwind

I think I see what is happening, you are trying to provide the certs a+b+c of a cert chain as cert: [a, b, c]. This is invalid usage, not documented, and doesn't surprise me it doesn't work (though honestly, it wouldn't surprise me if it had worked, either, ossl is a bit weird). Also, I think you haven't noticed that the PEM files built by the Makefile are chains (they have multiple certs in the single PEM file if there are intermediates).

Pre-existing test with pre-existing agent6 cert:

  • https://github.com/sam-github/node/blob/d125ee843b015ec9751562945426f620021ba19c/test/parallel/test-tls-multi-key.js#L80-L97

This PR adds tests for mixed algorithm identies, where the mixed algs have intermediate certs:

  • node/test/parallel/test-tls-cert-chains-concat.js

    Lines 18 to 21 in ac602a2

    server: {
    cert: keys.agent6.cert,
    key: keys.agent6.key,
    },

Your example:

cert: [agent10-cert, ca4-cert]
key: agent10-key

is invalid usage. agent10-cert.pem is a CHAIN, it already contains ca4-cert.pem, as did the pre-existing cert that had an intermediate cert, agent6:

  • https://github.com/sam-github/node/blob/d125ee843b015ec9751562945426f620021ba19c/test/fixtures/keys/Makefile#L353
  • https://github.com/sam-github/node/blob/d125ee843b015ec9751562945426f620021ba19c/test/fixtures/keys/Makefile#L464

Docs say:

Optional cert chains in PEM format. One cert chain should be provided per private key. Each cert chain should consist of the PEM formatted certificate for a provided private key, followed by the PEM formatted intermediate certificates (if any), in order, and not including the root CA (the root CA must be pre-known to the peer, see ca).

Your example above has two identities, one is agent10+ca4, and the other is just ca4. This is weird, because ca4 is a sub-chain of the first identity, and also, because they are both RSA, and OpenSSL doesn't permit multiple identities of the same algorithm, because it doesn't know which one to pick (unless you use SNI callback, when it picks by the server name).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@silverwind

silverwind commented Feb 14, 2017

Copy link
Copy Markdown
Contributor

Sorry, for agent10-cert I actually meant just the first cert, not the whole chain in that file. Let's call the individual certs agent10-cert and agent10-int to avoid confusion.

So the interesting part is that it works if I concatenate agent10-cert and agent10-int into a single file, but not if I provide them individually in the form [agent10-cert, agent10-int]. I think this should be fixable.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sam-github

sam-github commented Feb 14, 2017

Copy link
Copy Markdown
Contributor Author

So the interesting part is that it works if I concatenate agent10-cert and agent10-int into a single file, but not if I provide them individually in the form [agent10-cert, agent10-int]. I think this should be fixable.

Exactly. That is the documented behaviour, so lets not hijack this PR to discuss it further, now that we agree what is happening. Open another issue if you think there is a problem and we can discuss there.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sam-github
sam-github force-pushed the generate-more-certs branch from 8165817 to 01da330 Compare February 14, 2017 18:56
@shigeki

shigeki commented Feb 23, 2017

Copy link
Copy Markdown
Contributor

One thing I would note is that it would be extremely helpful to have some documentation around these to help folks understand how and where to use the keys, how and where they are already used, etc.

I agree. I also would like to change file names and cert attributes to see its use and purpose for ease.

sam-github reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sam-github
sam-github force-pushed the generate-more-certs branch 3 times, most recently from e089bd0 to 3ed5993 Compare March 6, 2017 23:04
@sam-github

sam-github commented Mar 6, 2017

Copy link
Copy Markdown
Contributor Author

@shigeki PTAL

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sam-github
sam-github force-pushed the generate-more-certs branch from 3ed5993 to bb8c327 Compare March 20, 2017 15:42
@sam-github

sam-github commented Apr 3, 2017

Copy link
Copy Markdown
Contributor Author

@shigeki any more comments I can address?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@refack
refack force-pushed the master branch from 16073c0 to fbe946b Compare April 14, 2017 04:11
@sam-github
sam-github force-pushed the generate-more-certs branch from bb8c327 to 912d645 Compare April 17, 2017 20:27
@sam-github

sam-github commented May 24, 2017

Copy link
Copy Markdown
Contributor Author

@shigeki ping

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sam-github
sam-github force-pushed the generate-more-certs branch from 912d645 to 2089d22 Compare June 14, 2017 16:03
@sam-github

sam-github commented Jun 14, 2017

Copy link
Copy Markdown
Contributor Author

@shigeki I have responded to all comments, how can I move this forward?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sam-github
sam-github force-pushed the generate-more-certs branch from 2089d22 to 9f90b7b Compare July 21, 2017 16:51
@sam-github
sam-github dismissed shigeki’s stale review July 21, 2017 16:51

addressed comments, no replies to request for more comments

@sam-github

sam-github commented Jul 21, 2017

Copy link
Copy Markdown
Contributor Author

ci: https://ci.nodejs.org/job/node-test-pull-request/9285/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@BridgeAR

BridgeAR commented Aug 26, 2017

Copy link
Copy Markdown
Member

@sam-github would you be so kind and rebase? I guess it is otherwise ready?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sam-github
sam-github force-pushed the generate-more-certs branch from 9f90b7b to e1e40ad Compare September 7, 2017 20:58
@sam-github sam-github mentioned this pull request Sep 7, 2017
seems to not account for when a review has been dismissed nodejs/node-review#14
Closed
@BridgeAR

BridgeAR commented Sep 8, 2017

Copy link
Copy Markdown
Member

New CI https://ci.nodejs.org/job/node-test-pull-request/9990/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@BridgeAR

BridgeAR commented Sep 8, 2017

Copy link
Copy Markdown
Member

@mhdawson @bnoordhuis would you be so kind and reconfirm your LG?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

mhdawson
mhdawson approved these changes Sep 8, 2017
View reviewed changes

@mhdawson mhdawson left a comment

Copy link
Copy Markdown
Member

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.

LGTM

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@BridgeAR

BridgeAR commented Sep 9, 2017

Copy link
Copy Markdown
Member

@sam-github the CI is dark red. Seems like some tests need some additional work.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

sam-github added 4 commits September 11, 2017 10:51
@sam-github
test: rename agent1-pfx.pem to agent1.pfx
89d57b4
PFX is not PEM, its binary DER. Use the same .pfx extension as
test/fixtures/test_cert.pfx does.
@sam-github
test: add independent multi-alg crypto identities
0bc3166
agent6 was the only cert that had a chain (an intermediate certificate),
and there were no non-RSA certs other than a single self-signed one.
This makes it impossible to test cert-chain scenarios with multiple
identities which require chains to prove chain completion, and
multi-algorithm because OpenSSL doesn't support multiple identities
unless they are multi-algorithm.

PFX files were also missing for most identities, making it difficult to
test multi-PFX and PFX interactions with cert-chain+key and CA options.

New server cert chains:

- ECC: ca5 signs ca6 signs ec10, CN=agent10.example.com
- RSA: ca2 signs ca4 signs agent10, CN=agent10.example.com

PFX added for:

- agent6
- agent10
- ec10
@sam-github
test: cover tls multi-identity option mixtures
c4d269f
Prove that cert and key options do not have to be ordered, and that the
pfx option can be used at the same time as the cert/key option
(which was claimed to be impossible by some pre-existing documentation).
@sam-github
test: confirm tls server suite default is its own
64d61e9
When honorCipherOrder is not explicitly set, it defaults to true, cover
this condition in the test. Also, run all tests in parallel, instead of
sequentially.
@sam-github
sam-github force-pushed the generate-more-certs branch from e1e40ad to 64d61e9 Compare September 11, 2017 17:51
@sam-github sam-github closed this Sep 19, 2017
This was referenced Nov 14, 2018
TLS certificate object documentation and support for EC certificates #24358
Closed
generate more certs, and more test coverage using them #24374
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@bnoordhuis bnoordhuis bnoordhuis approved these changes
+2 more reviewers
@shigeki shigeki shigeki left review comments
@mhdawson mhdawson mhdawson approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

test Issues and PRs related to Node.js core tests and test infrastructure. tls Issues and PRs related to the tls subsystem.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

10 participants

@sam-github @silverwind @shigeki @jasnell @BridgeAR @bnoordhuis @mhdawson @mscdex @targos @nodejs-github-bot
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.