From 3891b73c4432dc19f9237bb40069bd8837bd8fbe Mon Sep 17 00:00:00 2001 From: Stu Tomlinson Date: Fri, 10 Jun 2022 15:41:35 +0100 Subject: [PATCH] Open PKCS12 files as binary Opening as text on Windows causes read failures: tls DEBUG error:0680008E:asn1 encoding routines::not enough data --- src/tls_openssl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tls_openssl.c b/src/tls_openssl.c index 097b666..19deae9 100644 --- a/src/tls_openssl.c +++ b/src/tls_openssl.c @@ -974,7 +974,7 @@ _tls_cert_read_p12(xmpp_conn_t *conn, EVP_PKEY **pkey, STACK_OF(X509) * *ca) return conn->tls->client_cert; X509 *cert = NULL; PKCS12 *p12 = NULL; - BIO *f = BIO_new_file(conn->tls_client_key, "r"); + BIO *f = BIO_new_file(conn->tls_client_key, "rb"); if (!f) { strophe_debug(conn->ctx, "tls", "f == NULL"); goto error_out;