warmcat / libwebsockets

canonical libwebsockets.org networking library
https://libwebsockets.org
Other
4.73k stars 1.48k forks source link

version 4.3 error E: SSL_new failed: error:00000063:lib(0)::reason(99) #3059

Open williamfjm opened 7 months ago

williamfjm commented 7 months ago

hello ,im new using libewebsockets ,but I think I found a bug , with version 4.3 and openssl v3.0.11

wheen i try compile previus version like 4.1 i have this issue /root/ws/libwebsockets_4.2_mal/lib/tls/openssl/openssl-server.c: In function ‘lws_tls_server_certs_load’: /root/ws/libwebsockets_4.2_mal/lib/tls/openssl/openssl-server.c:403:9: error: ‘EC_KEY_new_by_curve_name’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations] 403 | ecdh = EC_KEY_new_by_curve_name(ecdh_nid); i think this could be a clue. Is this problem documented?

lws-team commented 7 months ago

At context creation time, info.options has LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT when creating the context?

williamfjm commented 7 months ago

yes ,i do

struct lws_context_creation_info info;

memset(&info, 0, sizeof(info));
info.port = CONTEXT_PORT_NO_LISTEN;
info.options = LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT;
info.protocols = protocols;
context = lws_create_context(&info);
if (context == NULL) {
    fprintf(stderr, "error libwebsockets\n");
    return -1;
}

// Configura la información de la conexión WebSocket
memset(&connect_info, 0, sizeof(connect_info));

connect_info.context = context;
connect_info.port =1111;
connect_info.address = "xxxxxxxxxxxxxx";
connect_info.path = "/";
connect_info.host = connect_info.address;
connect_info.origin = connect_info.address;
connect_info.ssl_connection = ssl_connection;
connect_info.protocol = pro;
connect_info.local_protocol_name = "lws-minimal-client";
  struct lws *wsi = lws_client_connect_via_info(&connect_info);

  this is part of my code it works on version 4.1 
Arthur-Lili-Pendragon commented 4 months ago

I also encountered the same error message, but I did not assign a value to info.options. May I ask how to resolve this error?

lws-team commented 4 months ago

info.options at context creation time must at least have LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT, else openssl doesn't get started