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

Ssl try #105

Closed
wants to merge 2 commits into from
Closed

Ssl try #105

wants to merge 2 commits into from

Conversation

lgg2
Copy link

@lgg2 lgg2 commented Oct 31, 2024

Hello,

Included Openssl initial/basic support.

Compile with CFLAGS+="-DENABLE_OPENSSL=yes" make

Only echo example changed to test. Use wss option and place the correct url and port in the Server input box.

This add 2 new (internal) functions that maybe join into only one and change the send/recv for the Openssl equivalents.

It must be a valid cert.pem and key.pem into cert directory. If not, the browser may refuse to accept the connection (with selfsigned certs for localhost I have problems).

Be free to refactor the added parts. Are easy to understand how works. You know better wsServer part.

All info extracted from Openssl Wiki example.

… better integration (a bit more of work), but works.
… better integration (a bit more of work), but works. Compile with `CFLAGS+="-DENABLE_OPENSSL=yes" make'
@Theldus Theldus self-requested a review October 31, 2024 23:59
Copy link
Owner

@Theldus Theldus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @lgg2,
Thank you for your PR, as you might note, this is a feature I wanted for a long time, but I always post-poned, until now... so thank you for addressing it.

Having native support for SSL, although via an additional dependency, addresses issues like #88 and #77, so definitely a wanted feature.

That said, there are some things that I want to change on this PR, so I'll probably merge it on a different branch, work on that, and later merge everything to master.

For the time being, there also some things I must point out:

  • I still see some reformating throughout all the code, which makes hard to understand your real changes.
  • The other ones I'll comment right below.

@Theldus
Copy link
Owner

Theldus commented Nov 1, 2024

There is also build issues due to the lack of the library, but I'll tackle that, so no need to worry about it.

@lgg2
Copy link
Author

lgg2 commented Nov 14, 2024

Hello,

I will try to make the needed correct changes before pull again.

About the activation of "wss" mode: to include 2 pointers to string into struct ws_server for the "cert" and "key". If the are not NULL and valid, then work in "wss" mode, else "ws".

Also need the inclusion of SSL *ssl pointer in struct ws_connection, SSL_ctx *ssl_ctx and an additional function (among some few lines more) in the ws.c file.

In that way, there is no need to touch any code that use the wsServer.

I will try to pull again when done.

@lgg2 lgg2 closed this Nov 15, 2024
@lgg2 lgg2 deleted the SSL_try branch November 15, 2024 08:29
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

Successfully merging this pull request may close these issues.

3 participants