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

mangos.Pipe.GetOption(mangos.OptionTLSConnState) is invalid #313

Open
Pekuee opened this issue Feb 12, 2025 · 1 comment
Open

mangos.Pipe.GetOption(mangos.OptionTLSConnState) is invalid #313

Pekuee opened this issue Feb 12, 2025 · 1 comment

Comments

@Pekuee
Copy link

Pekuee commented Feb 12, 2025

protocol: req + xrep
transport: tls + tcp

After the certificate is configured, it can send and receive messages normally.
However, does not take effect when a pipe.GetOption(mangos.OptionTLSConnState) is used in a SetPipeEventHook(case mangos.PipeEventAttached) on the server side. The length of tls.ConnectionState.PeerCertificates is 0.

@Pekuee
Copy link
Author

Pekuee commented Feb 21, 2025

I think I should have found the reason.

https://github.com/nanomsg/mangos/blob/master/transport/tlstcp/tlstcp.go#L187

p.SetOption(mangos.OptionTLSConnState, tc.ConnectionState())

tc.ConnectionState() is invalid before completing the handshake, so it should be set after completing the handshake.
or other better solutions?

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