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

Export sslHandle in net and asyncnet #17021

Closed
ardek66 opened this issue Feb 12, 2021 · 1 comment · Fixed by #17573
Closed

Export sslHandle in net and asyncnet #17021

ardek66 opened this issue Feb 12, 2021 · 1 comment · Fixed by #17573

Comments

@ardek66
Copy link
Contributor

ardek66 commented Feb 12, 2021

Summary

Export the sslHandle field of sockets in net and asyncnet respectively,
just like SslContext exports context.

Description

Currently, the only way of using libssl procedures that take an ssl handle as a parameter(be them from openssl or imported through FFI separately) is by either rewritting the socket wrapping procedure or include-ing net or asyncnet, both of which being quite overkill for achieving simple tasks, even calling simple procedures from the stdlib openssl such as SSL_get_error or SSL_get_peer_certificate.

The SslContext itself allows us to access the low-level context, why shouldn't Socket?

Alternatives

One could add the needed procedures to the nim openssl, but then comes the problem if it is actually needed, or if it keeps
compatibility with the rest, making development of both openssl and the program itself harder.

Additional Information

This problem can be seen discussed here

@ringabout
Copy link
Member

@ardek66

make a PR?

ardek66 added a commit to ardek66/Nim that referenced this issue Mar 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants