Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FluentFtp.GnuTls client side connection to server on MacOS #1632

Open
bow-meow opened this issue Aug 9, 2024 · 10 comments
Open

FluentFtp.GnuTls client side connection to server on MacOS #1632

bow-meow opened this issue Aug 9, 2024 · 10 comments

Comments

@bow-meow
Copy link

bow-meow commented Aug 9, 2024

FTP Server OS: Mac

FTP Server Type: FileZilla

Client Computer OS: Mac

FluentFTP Version:
FluentFTP Version= 50.1.0
FluentFTP.GnuTLS Version= 1.0.31

Framework: .NET 6

I saw that FluentFtp.GnuTls says it supports macOS, but when I try to use it to connect to an ftp server, it says it cannot find linux system files? Looking at the source code for FluentFtp.GnuTls, I see that it only really handles linux and windows. So is it not compatible with macOS?

@FanDjango
Copy link
Collaborator

It should work (but I have never done it):

You need to build (no need, really) or install GnuTLS and its helper libraries.

These need to be able to be found, we can discuss that some more, how to check.

Try with this: https://macappstore.org/gnutls/

@FanDjango
Copy link
Collaborator

We check the platform ID (https://learn.microsoft.com/de-de/dotnet/api/system.platformid?view=net-8.0) and accept "6", which is MacOSX.

@bow-meow
Copy link
Author

bow-meow commented Aug 9, 2024

Thank you FanDjango for your response. I have installed gnutls on my Mac but I'm still having problems.

Here is the exception I get:

Exception thrown: 'FluentFTP.GnuTLS.GnuTlsException' in System.Private.CoreLib.dll: 'GnuTLS .dll load/call validation error'
 Inner exceptions found, see $exception in variables window for more details.
 Innermost exception 	 System.DllNotFoundException : Unable to load shared library 'libdl.so.2' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable: dlopen(liblibdl.so.2, 0x0001): tried: 'liblibdl.so.2' (no such file), '/System/Volumes/Preboot/Cryptexes/OSliblibdl.so.2' (no such file), 

The extension of the file its trying to use is linux related which I wonder if that is the problem?

@FanDjango
Copy link
Collaborator

Ok. The fault seems to be that on MacOSX, there is no need to load ldlib.so.2 to be able to access dlerror, dlopen and dlclose.

I will try to make a change to cater for this, then send you the link for a "special" branch of mine and you can test.

@FanDjango
Copy link
Collaborator

Can you first check if this is any help:

dotnet/dotnet-docker#4938 (comment)

@FanDjango
Copy link
Collaborator

And, if you set the environment variable
DYLD_PRINT_LIBRARIES
prior to your dotnet run, you will get debug output of all dll he is wanting to load, their exact names and where he is looking for them. You could then check if these are actually present at that location.

@FanDjango
Copy link
Collaborator

Note also that libdl is part of std set of libraries available on linux(-like) systems. we use it to load the gnutls dlls. So he is not even getting that far.

@bow-meow
Copy link
Author

bow-meow commented Aug 9, 2024

this sounds right

Ok. The fault seems to be that on MacOSX, there is no need to load ldlib.so.2 to be able to access dlerror, dlopen and dlclose.

I will try to make a change to cater for this, then send you the link for a "special" branch of mine and you can test.

this won't help as its for linux and these files don't exist on MacOS, the installation of gnutls does not come with those files as far as I can see

Can you first check if this is any help:

https://github.com/dotnet/dotnet-docker/discussions/4938#discussioncomment-7892892

I found this about libdl if it helps?
att/ast#295

I think the key thing here is that you're trying to use a file that does not exist on Mac, and it does not exist in the gnutls files downloaded.

I did notice that I was using home-brew arm64, which was installing gnutls to a different location than usr/local/.., and have now installed the 64bit version of home-brew with the 64bit version of gnutls which is installed to the correct location but im still getting the same issue where it tries to load a .so file which doesn't exist

@FanDjango
Copy link
Collaborator

Can you please find out on your Macosx if you have any libdl.* files in /usr/lib64/? Regardless of their name ending?

@FanDjango
Copy link
Collaborator

I was really hoping to get some information here to solve this problem. Well...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants