1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-16 00:00:07 +01:00

wolfssl: update membuf to use lws alloc

https://github.com/warmcat/libwebsockets/issues/3349
This commit is contained in:
Albert Ribes 2025-03-13 16:07:24 +00:00 committed by Andy Green
parent ef4a85d0e1
commit 2d08ea5211

View file

@ -329,19 +329,19 @@ lws_tls_server_certs_load(struct lws_vhost *vhost, struct lws *wsi,
* The passed memory-buffer cert image is in DER, and the
* memory-buffer private key image is PEM.
*/
#ifndef USE_WOLFSSL
if (lws_tls_alloc_pem_to_der_file(vhost->context, cert, mem_cert,
mem_cert_len, &p, &flen)) {
lwsl_err("%s: couldn't convert pem to der\n", __func__);
return 1;
}
#ifndef USE_WOLFSSL
if (SSL_CTX_use_certificate_ASN1(vhost->tls.ssl_ctx,
(int)flen,
(uint8_t *)p) != 1) {
#else
if (wolfSSL_CTX_use_certificate_buffer(vhost->tls.ssl_ctx,
(uint8_t *)mem_cert,
(int)mem_cert_len,
(uint8_t *)p,
(int)flen,
WOLFSSL_FILETYPE_ASN1) != 1) {
#endif