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

[feature] Working SSL #104

Open
lgg2 opened this issue Oct 31, 2024 · 2 comments
Open

[feature] Working SSL #104

lgg2 opened this issue Oct 31, 2024 · 2 comments
Labels

Comments

@lgg2
Copy link

lgg2 commented Oct 31, 2024

Hello,

I have adapted the openssl example to wsServer and... works. Yes I have a working wss solution. But first I must any dummy to confirm this.

Place a cert.pem and a key.pem in place, open the port 8443 and try with the echo example.

Only 2 new functions (may be placed in one), a SSL_accept and change send/recv to SSL alternatives. No more needed.

@lgg2 lgg2 added the feature label Oct 31, 2024
@Theldus
Copy link
Owner

Theldus commented Oct 31, 2024

Hi @lgg2,
Wow, that's awesome, can you point to me that source, so I can try and test?
May I assume is this one right here? lgg2@e8733d2

If so, that's nice, I wouldn't expected to be that simple, since OpenSSL is too much complex, and etc. Please go ahead and send a PR, just a few notes first:

  • It looks like the code has been reformatted, which I usually don't like... since it breaks the commit history a bit when you do a 'blame'. Did you use clang-format by any chance? If so, that's fine.

  • I would like this to be added conditionally so that wsServer still works in an environment without OpenSSL, something like: #ifdef ENABLE_OPENSSL.

  • In your code I didn't see any changes to the build scripts, like in the Makefile or CMakeLists.txt.

In general, I would like to receive these changes so that I can test them right away with a make or CFLAGS="-DENABLE_OPENSSL=yes" make. If you have trouble with this, you can send it as is.

@lgg2
Copy link
Author

lgg2 commented Oct 31, 2024

Hello,

Sorry for the reformat. It has been thing of VScode. I will re-do the thing.

And yes, I will place the conditional include. Also, the only change in Makefile it is the addition of -lssl and -lcrypto

I will do it tomorrow.

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