Mercurial
diff seobeo/s_ssl.c @ 96:70401cf61e97
[Seobeo] Added logging.
| author | June Park <parkjune1995@gmail.com> |
|---|---|
| date | Fri, 02 Jan 2026 19:16:17 -0800 |
| parents | 6626ec933933 |
| children |
line wrap: on
line diff
--- a/seobeo/s_ssl.c Fri Jan 02 19:11:35 2026 -0800 +++ b/seobeo/s_ssl.c Fri Jan 02 19:16:17 2026 -0800 @@ -17,12 +17,12 @@ { if (!p_handle) return -1; - printf("USE SSL\n\n"); + Seobeo_Log(SEOBEO_INFO, "Using SSL/TLS encryption\n"); Seobeo_Web_SSL_Init(); p_handle->ssl_ctx = SSL_CTX_new(TLS_client_method()); if (!p_handle->ssl_ctx) { - fprintf(stderr, "SSL_CTX_new failed\n"); + Seobeo_Log(SEOBEO_ERROR, "SSL_CTX_new failed\n"); ERR_print_errors_fp(stderr); return -1; } @@ -32,7 +32,7 @@ p_handle->ssl = SSL_new(p_handle->ssl_ctx); if (!p_handle->ssl) { - fprintf(stderr, "SSL_new failed\n"); + Seobeo_Log(SEOBEO_ERROR, "SSL_new failed\n"); ERR_print_errors_fp(stderr); SSL_CTX_free(p_handle->ssl_ctx); p_handle->ssl_ctx = NULL; @@ -47,7 +47,7 @@ if (SSL_connect(p_handle->ssl) != 1) { - fprintf(stderr, "SSL_connect failed\n"); + Seobeo_Log(SEOBEO_ERROR, "SSL_connect failed\n"); ERR_print_errors_fp(stderr); SSL_free(p_handle->ssl); SSL_CTX_free(p_handle->ssl_ctx); @@ -126,7 +126,7 @@ int Seobeo_SSL_Setup_Client(Seobeo_Handle *p_handle, const char *host, int socket_fd) { (void)p_handle; (void)host; (void)socket_fd; - fprintf(stderr, "SSL support not compiled in\n"); + Seobeo_Log(SEOBEO_WARNING, "SSL support not compiled in\n"); return -1; } void Seobeo_SSL_Cleanup(Seobeo_Handle *p_handle) { (void)p_handle; }