You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2024/06/28 12:25:14 UTC

(tomcat) branch main updated: Remove MacOS workaround

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

remm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
     new 61f8c08253 Remove MacOS workaround
61f8c08253 is described below

commit 61f8c08253746733f73209522f37182a9d672bd1
Author: remm <re...@apache.org>
AuthorDate: Fri Jun 28 14:24:47 2024 +0200

    Remove MacOS workaround
    
    ssl.XX as the library name works, however after examining the logs and
    the sources, the library is not compatible enough with OpenSSL to be
    able to be used using FFM (supposed compatibilty is achieved using
    macros).
    As a result, it is more reasonable to revert completely. A user should
    then be able to install the regular OpenSSL on the libpath where it
    would be loaded from by Tomcat.
---
 java/org/apache/tomcat/util/openssl/openssl_h.java | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/java/org/apache/tomcat/util/openssl/openssl_h.java b/java/org/apache/tomcat/util/openssl/openssl_h.java
index efcf26d715..a8f5777bdb 100644
--- a/java/org/apache/tomcat/util/openssl/openssl_h.java
+++ b/java/org/apache/tomcat/util/openssl/openssl_h.java
@@ -22,7 +22,6 @@ package org.apache.tomcat.util.openssl;
 import java.lang.invoke.MethodHandle;
 import java.lang.invoke.MethodHandles;
 import java.util.Arrays;
-import java.util.Locale;
 import java.util.stream.Collectors;
 import java.lang.foreign.*;
 import static java.lang.foreign.ValueLayout.*;
@@ -50,14 +49,7 @@ public class openssl_h {
     static final boolean TRACE_DOWNCALLS = Boolean.getBoolean("jextract.trace.downcalls");
     static final SymbolLookup SYMBOL_LOOKUP;
     static {
-        String os = System.getProperty("os.name").toLowerCase(Locale.ENGLISH);
-        String libName = "ssl";
-        // Note: Some system libraries such as libcrypto must use a versioned name on MacOS
-        // See https://github.com/sergot/openssl/issues/81
-        if (os.indexOf("mac") >= 0) {
-            libName = "ssl.46";
-        }
-        SYMBOL_LOOKUP = SymbolLookup.libraryLookup(System.mapLibraryName(libName), LIBRARY_ARENA)
+        SYMBOL_LOOKUP = SymbolLookup.libraryLookup(System.mapLibraryName("ssl"), LIBRARY_ARENA)
                 .or(SymbolLookup.loaderLookup())
                 .or(Linker.nativeLinker().defaultLookup());
     }


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


Re: (tomcat) branch main updated: Remove MacOS workaround

Posted by Rémy Maucherat <re...@apache.org>.
On Mon, Jul 1, 2024 at 5:00 PM Mark Thomas <ma...@apache.org> wrote:
>
> On 28/06/2024 13:25, remm@apache.org wrote:
> > This is an automated email from the ASF dual-hosted git repository.
> >
> > remm pushed a commit to branch main
> > in repository https://gitbox.apache.org/repos/asf/tomcat.git
> >
> >
> > The following commit(s) were added to refs/heads/main by this push:
> >       new 61f8c08253 Remove MacOS workaround
> > 61f8c08253 is described below
> >
> > commit 61f8c08253746733f73209522f37182a9d672bd1
> > Author: remm <re...@apache.org>
> > AuthorDate: Fri Jun 28 14:24:47 2024 +0200
> >
> >      Remove MacOS workaround
>
> I'm afraid I am going to need to make further changes to this.
>
> The issue appears to be that
> SymbolLookup.libraryLookup(System.mapLibraryName("ssl"), LIBRARY_ARENA)
> ignores java.library.path
>
> That in turns causes crashes (at least in the tests) when it tries to
> load the LibreSSL implementation that ships with MacOS.
>
> I think we need to go back to the version that was MacOS specific and
> used System.loadLibrary("ssl");

Ok. After testing it didn't seem to me like it was adding anything
since it's not really a crash.

> I am also seeing an issue where the TLS 1.3 client cert test that
> requires BEFORE_INIT_EVENT to be called on the listener before the test.

Not sure I understand, the one in TestOpenSSLConf needed it, but I
didn't notice anything wrong with TestClientCertTls13. Feel free to
add it if needed.

Rémy

> I have these changes working locally on my M1 mac but they need cleaning
> up. My plan is to do the clean-up, test on my M1, commit and then test
> on MacOS Intel, Linux and Windows.
>
> Mark
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>

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


Re: (tomcat) branch main updated: Remove MacOS workaround

Posted by Mark Thomas <ma...@apache.org>.
On 28/06/2024 13:25, remm@apache.org wrote:
> This is an automated email from the ASF dual-hosted git repository.
> 
> remm pushed a commit to branch main
> in repository https://gitbox.apache.org/repos/asf/tomcat.git
> 
> 
> The following commit(s) were added to refs/heads/main by this push:
>       new 61f8c08253 Remove MacOS workaround
> 61f8c08253 is described below
> 
> commit 61f8c08253746733f73209522f37182a9d672bd1
> Author: remm <re...@apache.org>
> AuthorDate: Fri Jun 28 14:24:47 2024 +0200
> 
>      Remove MacOS workaround

I'm afraid I am going to need to make further changes to this.

The issue appears to be that 
SymbolLookup.libraryLookup(System.mapLibraryName("ssl"), LIBRARY_ARENA) 
ignores java.library.path

That in turns causes crashes (at least in the tests) when it tries to 
load the LibreSSL implementation that ships with MacOS.

I think we need to go back to the version that was MacOS specific and 
used System.loadLibrary("ssl");


I am also seeing an issue where the TLS 1.3 client cert test that 
requires BEFORE_INIT_EVENT to be called on the listener before the test.

I have these changes working locally on my M1 mac but they need cleaning 
up. My plan is to do the clean-up, test on my M1, commit and then test 
on MacOS Intel, Linux and Windows.

Mark

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