mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
tls: openssl: use lws pem_to_der first for mem cert
https://github.com/warmcat/libwebsockets/issues/1620
This commit is contained in:
parent
79bb26b6bd
commit
17920cadf5
1 changed files with 7 additions and 2 deletions
|
@ -302,9 +302,14 @@ lws_tls_server_certs_load(struct lws_vhost *vhost, struct lws *wsi,
|
|||
* 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;
|
||||
}
|
||||
if (SSL_CTX_use_certificate_ASN1(vhost->tls.ssl_ctx,
|
||||
(int)mem_cert_len,
|
||||
(uint8_t *)mem_cert) != 1) {
|
||||
(int)flen,
|
||||
(uint8_t *)p) != 1) {
|
||||
#else
|
||||
if (wolfSSL_CTX_use_certificate_buffer(vhost->tls.ssl_ctx,
|
||||
(uint8_t *)mem_cert,
|
||||
|
|
Loading…
Add table
Reference in a new issue