Skip to content
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

Key Values Mismatch when providing multiple certificates/keys #20780

Closed
cmenning opened this issue May 16, 2018 · 5 comments
Closed

Key Values Mismatch when providing multiple certificates/keys #20780

cmenning opened this issue May 16, 2018 · 5 comments
Labels
invalid Issues and PRs that are invalid. tls Issues and PRs related to the tls subsystem.

Comments

@cmenning
Copy link

Per the documentation, it should be possible to provide multiple keys and certificates when creating a secure context. However, when doing so I am receiving the following error message:

_tls_common.js:140
c.context.setKey(pem, val.passphrase || passphrase);
^

Error: error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch

Here is my test code:

var options = {
    key: [key1, key2],
    cert: [cert1, cert2],
    ca: caCert
};
var server = https.createServer(options);

If I provide only cert1 and key1, or cert2 and key2, the server is created successfully. When both are provided, the server fails to be created.

@bnoordhuis bnoordhuis added the tls Issues and PRs related to the tls subsystem. label May 16, 2018
@bnoordhuis
Copy link
Member

Can you post a complete test case? By 'complete' I mean 'ready to run.'

FWIW, you can look at test/parallel/test-tls-multi-key.js for a multi-cert/multi-key example.

@bnoordhuis
Copy link
Member

No follow-up, closing.

@bnoordhuis bnoordhuis added the invalid Issues and PRs that are invalid. label May 28, 2018
@elsharkawey
Copy link

did you found a solution ?

@Llorx
Copy link

Llorx commented Aug 3, 2021

Exactly having the same problem. Also test test/parallel/test-tls-multi-key.js is not present, but looking at git history, I have my code exactly the same as the test, with the difference that 1 cert/key pair is signed with a 1024 CA and the other with a 2048 CA.

@xiaomo1q
Copy link

Is there a solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid Issues and PRs that are invalid. tls Issues and PRs related to the tls subsystem.
Projects
None yet
Development

No branches or pull requests

5 participants