Project homepage Mailing List  Warmcat.com  API Docs  Github Mirror 
{"schema":"libjg2-1", "vpath":"/git/", "avatar":"/git/avatar/", "alang":"", "gen_ut":1747291707, "reponame":"libwebsockets", "desc":"libwebsockets lightweight C networking library", "owner": { "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" },"url":"https://libwebsockets.org/repo/libwebsockets", "f":3, "items": [ {"schema":"libjg2-1", "cid":"25b34d6677fab2489162e3e577cc44c0", "commit": {"type":"commit", "time": 1298106551, "time_ofs": 0, "oid_tree": { "oid": "f4b89afb2cd2f421cd52b647c712738304b8186c", "alias": []}, "oid":{ "oid": "0894bda18419834274d7555bc3e300307a4542ac", "alias": []}, "msg": "add callback to allow additional client verification certs", "sig_commit": { "git_time": { "time": 1298106551, "offset": 0 }, "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" }, "sig_author": { "git_time": { "time": 1298106551, "offset": 0 }, "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" }}, "body": "add callback to allow additional client verification certs\n\nSigned-off-by: Andy Green \u003candy@warmcat.com\u003e\n" , "diff": "diff --git a/lib/libwebsockets.c b/lib/libwebsockets.c\nindex f94b11c..aaf991a 100644\n--- a/lib/libwebsockets.c\n+++ b/lib/libwebsockets.c\n@@ -1596,6 +1596,16 @@ libwebsocket_create_context(int port, const char *interface,\n \t\t\t\t\t\t LWS_OPENSSL_CLIENT_CERTS);\n \t}\n \n+\t/*\n+\t * callback allowing user code to load extra verification certs\n+\t * helping the client to verify server identity\n+\t */\n+\n+\tthis-\u003eprotocols[0].callback(this, wsi,\n+\t\tLWS_CALLBACK_OPENSSL_LOAD_EXTRA_CLIENT_VERIFY_CERTS,\n+\t\tthis-\u003essl_client_ctx, NULL, 0);\n+\n+\n \tif (this-\u003euse_ssl) {\n \n \t\t/* openssl init for server sockets */\ndiff --git a/lib/libwebsockets.h b/lib/libwebsockets.h\nindex acb27b1..0890c9b 100644\n--- a/lib/libwebsockets.h\n+++ b/lib/libwebsockets.h\n@@ -43,6 +43,7 @@ enum libwebsocket_callback_reasons {\n \tLWS_CALLBACK_BROADCAST,\n \tLWS_CALLBACK_FILTER_NETWORK_CONNECTION,\n \tLWS_CALLBACK_FILTER_PROTOCOL_CONNECTION,\n+\tLWS_CALLBACK_OPENSSL_LOAD_EXTRA_CLIENT_VERIFY_CERTS,\n \n \t/* external poll() management support */\n \tLWS_CALLBACK_ADD_POLL_FD,\n@@ -201,6 +202,12 @@ struct libwebsocket_context;\n *\t\tcontent before deciding to allow the handshake to proceed or\n *\t\tto kill the connection.\n *\n+ * \tLWS_CALLBACK_OPENSSL_LOAD_EXTRA_CLIENT_VERIFY_CERTS: if configure for\n+ * \t\tincluding OpenSSL support, this callback allows your user code\n+ * \t\tto perform extra SSL_CTX_load_verify_locations() or similar\n+ *\t\tcalls to direct OpenSSL where to find certificates the client\n+ *\t\tcan use to confirm the remote server identity. @user is the\n+ *\t\tOpenSSL SSL_CTX*\n *\n *\tThe next four reasons are optional and only need taking care of if you\n * \twill be integrating libwebsockets sockets into an external polling\ndiff --git a/libwebsockets-api-doc.html b/libwebsockets-api-doc.html\nindex cd3e70d..ecb17ca 100644\n--- a/libwebsockets-api-doc.html\n+++ b/libwebsockets-api-doc.html\n@@ -580,7 +580,15 @@ use the header enums lws_token_indexes from libwebsockets.h\n to check for and read the supported header presence and\n content before deciding to allow the handshake to proceed or\n to kill the connection.\n-\u003cp\u003e\n+\u003c/blockquote\u003e\n+\u003ch3\u003eLWS_CALLBACK_OPENSSL_LOAD_EXTRA_CLIENT_VERIFY_CERTS\u003c/h3\u003e\n+\u003cblockquote\u003e\n+if configure for\n+including OpenSSL support, this callback allows your user code\n+to perform extra \u003cb\u003eSSL_CTX_load_verify_locations\u003c/b\u003e or similar\n+calls to direct OpenSSL where to find certificates the client\n+can use to confirm the remote server identity. \u003ctt\u003e\u003cb\u003euser\u003c/b\u003e\u003c/tt\u003e is the\n+OpenSSL SSL_CTX*\n \u003cp\u003e\n The next four reasons are optional and only need taking care of if you\n will be integrating libwebsockets sockets into an external polling\n","s":{"c":1747291707,"u": 3242}} ],"g": 4228,"chitpc": 0,"ehitpc": 0,"indexed":0 , "ab": 0, "si": 0, "db":0, "di":0, "sat":0, "lfc": "0000"}