Skip to content

[feature] Working SSL  #104

Open
Open

Description

@lgg2

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.

Activity

  1. Theldus commented on Oct 31, 2024

    @Theldus
    Owner

    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.

  2. lgg2 commented on Oct 31, 2024

    @lgg2
    Author

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions