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

mTLS connection is not working #147

Open
zenonhun opened this issue Mar 19, 2021 · 0 comments
Open

mTLS connection is not working #147

zenonhun opened this issue Mar 19, 2021 · 0 comments

Comments

@zenonhun
Copy link

The currently implemented TLSSocket handling is not working with mTLS.
Even if the ca, key, pem files are set in the protocolOptions, the connection throws invalid certificate errors.

I did a manual test with the TLSSocket:

let opts = { port, host, ca, key, pem };

let socket = new TLSSocket();
socket.connect(opts);
// throws invalid certificate error. The client certificate is not sent properly.

socket=new TLSSocket(new Socket(opts), opts);
socket.connect(opts);
// no exception, however the socket stuck in 'opening' state

socket = tls.connect(opts)
// this time the connection is successfully opened

Seems like there are a lots of logic in tls.connect, beside creating a TLSSocket:
https://github.com/nodejs/node/blob/43f599b534e60933e86db4d9ad87dfd8750a0f06/lib/_tls_wrap.js#L1590

So probably to make winston-syslog work with TLS, the tls.connect() approach would be better.

zenonhun added a commit to zenonhun/winston-syslog that referenced this issue Mar 21, 2021
zenonhun added a commit to zenonhun/winston-syslog that referenced this issue Mar 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant