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

TLS should log errors #1588

Closed
Sec42 opened this issue May 26, 2022 · 2 comments
Closed

TLS should log errors #1588

Sec42 opened this issue May 26, 2022 · 2 comments
Labels

Comments

@Sec42
Copy link

Sec42 commented May 26, 2022

Is your feature request related to a problem? Please describe.
When using the tls+tcp:// protocol I can not tell whether the connection does not work because the other side is not listening, or if the tls handshake is not working.

nng_pipe_notify() does not seem to have triggers for this case.

Describe the solution you'd like
Some way to get notified of the failed connection attempts. Preferably including a reason why the connection failed

Describe alternatives you've considered
It would probably be possible to do a connection attempt outside of nng to test for this case, but that seems convoluted.

Additional context
It would help me make my program more user-friendly to notify the end user of such a problem instead of waiting indefinitely for a connection.

@gdamore
Copy link
Contributor

gdamore commented May 30, 2022

the problem is that nni_pipe_notify() is only able to pick up post-negotiation. I need to think about adding either logging hooks or some kind of other callback mechanism for TLS.

@gdamore
Copy link
Contributor

gdamore commented May 30, 2022

If you're client side, nng_dial() should return an error, and the error code should discriminate between TLS and non-TLS errors (e.g. ECONNREFUSED). Getting more detail about the TLS error is harder. I'll think on this.

@gdamore gdamore added the tls label May 30, 2022
@gdamore gdamore changed the title detecting TLS errors TLS should log errors Apr 14, 2024
gdamore added a commit that referenced this issue Apr 14, 2024
This isn't complete, but it should go much further in assisting
debugging TLS related errors.
gdamore added a commit that referenced this issue Apr 14, 2024
This isn't complete, but it should go much further in assisting
debugging TLS related errors.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants