This is an automated email from the ASF dual-hosted git repository.
remm pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.1.x by this push:
new 303c1dc9dd Add comment to remember about the get0 call
303c1dc9dd is described below
commit 303c1dc9ddc533d6911201f7da338929ec41f01b
Author: remm <[email protected]>
AuthorDate: Mon Feb 23 11:30:36 2026 +0100
Add comment to remember about the get0 call
---
java/org/apache/tomcat/util/openssl/openssl_h_Compatibility.java | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/java/org/apache/tomcat/util/openssl/openssl_h_Compatibility.java
b/java/org/apache/tomcat/util/openssl/openssl_h_Compatibility.java
index 0db22d6f90..f30ff1bfa4 100644
--- a/java/org/apache/tomcat/util/openssl/openssl_h_Compatibility.java
+++ b/java/org/apache/tomcat/util/openssl/openssl_h_Compatibility.java
@@ -30,6 +30,7 @@ import static
org.apache.tomcat.util.openssl.openssl_h.SSL_get1_peer_certificate
public class openssl_h_Compatibility {
public static final boolean OPENSSL;
+ public static final boolean OPENSSL1;
public static final boolean OPENSSL3;
public static final boolean BORINGSSL;
public static final boolean LIBRESSL;
@@ -40,6 +41,7 @@ public class openssl_h_Compatibility {
static {
String versionString = OpenSSL_version(0).getString(0);
OPENSSL = versionString.contains("OpenSSL");
+ OPENSSL1 = OPENSSL && OpenSSL_version_num() < 0x3000000fL;
OPENSSL3 = OPENSSL && OpenSSL_version_num() >= 0x3000000fL;
BORINGSSL = versionString.contains("BoringSSL");
LIBRESSL = versionString.contains("LibreSSL");
@@ -148,6 +150,8 @@ public class openssl_h_Compatibility {
// OpenSSL 1.1 SSL_get_peer_certificate
public static MemorySegment SSL_get_peer_certificate(MemorySegment s) {
if (OPENSSL3) {
+ // This could be using SSL_get0_peer_certificate instead, but all
the other implementations
+ // use SSL_get_peer_certificate which is equivalent to
SSL_get1_peer_certificate
return SSL_get1_peer_certificate(s);
} else {
class Holder {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]