initial ssl support

This commit is contained in:
2025-05-08 18:31:06 +02:00
parent 8ff2bb608c
commit 79687bd48f
7 changed files with 79 additions and 32 deletions

View File

@@ -2,6 +2,8 @@
#define CWS_SERVER_H
#include <netdb.h>
#include <openssl/err.h>
#include <openssl/ssl.h>
#include <sys/socket.h>
#include "utils/config.h"
@@ -77,13 +79,6 @@ void cws_fd_set_nonblocking(int sockfd);
*/
int cws_server_accept_client(int sockfd, struct sockaddr_storage *their_sa, socklen_t *theirsa_size);
/**
* @brief Closes all the file descriptors opened
*
* @param[in] hashmap Clients hash map
*/
void cws_server_close_all_fds(cws_hashmap *hashmap);
/**
* @brief Disconnect a client
*
@@ -93,4 +88,8 @@ void cws_server_close_all_fds(cws_hashmap *hashmap);
*/
void cws_server_close_client(int epfd, int client_fd, cws_hashmap *hashmap);
/* Undocumented functions */
SSL_CTX *cws_ssl_create_context();
bool cws_ssl_configure(SSL_CTX *context, cws_config *config);
#endif