This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a commit to branch 1.3.x
in repository https://gitbox.apache.org/repos/asf/tomcat-native.git


The following commit(s) were added to refs/heads/1.3.x by this push:
     new e77dcb05d Fix a crash on Windows in SSLContext.setCACertificate()
e77dcb05d is described below

commit e77dcb05d395e7dec6ed071a332af0e7287e0c35
Author: Michael Osipov <micha...@apache.org>
AuthorDate: Thu May 16 17:48:26 2024 +0200

    Fix a crash on Windows in SSLContext.setCACertificate()
---
 native/src/sslcontext.c           | 2 +-
 xdocs/miscellaneous/changelog.xml | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/native/src/sslcontext.c b/native/src/sslcontext.c
index e3d67131d..76662cc09 100644
--- a/native/src/sslcontext.c
+++ b/native/src/sslcontext.c
@@ -709,7 +709,7 @@ TCN_IMPLEMENT_CALL(jboolean, SSLContext, 
setCACertificate)(TCN_STDARGS,
                 SSL_CTX_set_client_CA_list(c->ctx, ca_certs);
         }
         else {
-            if (!SSL_add_file_cert_subjects_to_stack(ca_certs, J2S(file)))
+            if (file != NULL && !SSL_add_file_cert_subjects_to_stack(ca_certs, 
J2S(file)))
                 ca_certs = NULL;
         }
         if (ca_certs == NULL && c->verify_mode == SSL_CVERIFY_REQUIRE) {
diff --git a/xdocs/miscellaneous/changelog.xml 
b/xdocs/miscellaneous/changelog.xml
index 027f715f7..d88705ed6 100644
--- a/xdocs/miscellaneous/changelog.xml
+++ b/xdocs/miscellaneous/changelog.xml
@@ -33,6 +33,13 @@
 </section>
 <section name="Changes in 1.3.1">
   <changelog>
+    <fix>
+      Fix a crash on Windows when <code>SSLContext.setCACertificate()</code>
+      is invoked with a <code>null</code> value for 
<code>caCertificateFile</code>
+      and a non-<code>null</code> value for <code>caCertificatePath</code>
+      until properly addressed with
+      https://github.com/openssl/openssl/issues/24416. (michaelo)
+    </fix>
   </changelog>
 </section>
 <section name="Changes in 1.3.0">


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to