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

Slombard/web 171 implement https #390

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

552020
Copy link
Collaborator

@552020 552020 commented May 23, 2024

I'll open this only for visibility. It has a batter version of the Debug::log function that takes also color as (optional) option. @dantol29

Sure! Here's a comprehensive list of what we have done so far and what remains to be done for implementing HTTPS support in your HTTP server, presented in a checklist format.

SSL Integration Checklist

  • SSLManager and SSLContext: Implemented singleton SSLManager and SSLContext classes for managing SSL/TLS initialization and context.

    • Initialized OpenSSL library in SSLManager.
    • Created an SSL context in SSLContext.
  • Accepting SSL Connections: Modified the acceptNewConnection method to handle SSL connections.

    • Checked if the incoming connection is on the HTTPS port.
    • Created an SSL object and performed the SSL handshake.
    • Passed the SSL object to the Connection object.
  • Read Data from SSL Connections: Implement SSL-enabled reading in the readSocket method of the Connection class.

    • If the connection is SSL, use SSL_read instead of recv.
  • Write Data to SSL Connections: Implement SSL-enabled writing in the writeSocket method of the Connection class.

    • If the connection is SSL, use SSL_write instead of send.
  • Cleanup SSL Resources: Ensure proper cleanup of SSL resources when a connection is closed.

    • Ensure SSL_shutdown and SSL_free are called in the closeClientConnection method.
  • Configuration: Ensure the server is correctly configured to differentiate between HTTP and HTTPS connections.

    • Define SSL_PORT and ensure it's used consistently.
    • Ensure server configuration supports both HTTP and HTTPS endpoints.

Copy link

linear bot commented May 23, 2024

WEB-171 Implement https

@dantol29
Copy link
Owner

Does not compile according to git actions

@552020 552020 marked this pull request as draft May 24, 2024 08:58
@552020
Copy link
Collaborator Author

552020 commented May 24, 2024

Does not compile according to git actions

It's a super rough Draft, sorry for not making it more clear. I opened it only to share the extended version of Debug::log.

@552020
Copy link
Collaborator Author

552020 commented May 26, 2024

Does not compile according to git actions

Now it's solved.

@552020
Copy link
Collaborator Author

552020 commented May 26, 2024

I mean. It compiles. Https is not implemented yet. The problem was that openssl needs to be installed as dependencies into the container of Github Actions.

552020 added 3 commits May 26, 2024 13:37
…nd add logic to acceptNewConnection to create a ssl struct for the connection and pass it to the Connection object on initialisation
@552020
Copy link
Collaborator Author

552020 commented May 26, 2024

Another couple of hours for another small step forward. More tomorrow. Not so far from the end.

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.

2 participants