geefr / beatsaber-linux-goodies

Mod installation scripts and other goodies to support Beat Saber on Linux
BSD 2-Clause "Simplified" License
132 stars 5 forks source link

Beataroni can't establish ssl connection #75

Closed Atemu closed 3 years ago

Atemu commented 3 years ago
Error fetching BS versions: The SSL connection could not be established, see inner exception.
Unhandled exception.
System.ArgumentNullException: Value cannot be null. (Parameter 'collection')
   at System.Collections.ObjectModel.ObservableCollection`1.CreateCopy(IEnumerable`1 collection, String paramName)
   at System.Collections.ObjectModel.ObservableCollection`1..ctor(IEnumerable`1 collection)
   at Beataroni.ViewModels.SettingsViewModel..ctor(Settings s)
   at Beataroni.ViewModels.MainWindowViewModel..ctor(Settings settings)
   at Beataroni.App.OnFrameworkInitializationCompleted()
   at Avalonia.Controls.AppBuilderBase`1.Setup()
   at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime[T](T builder, String[] args, ShutdownMode shutdownMode)
   at Beataroni.Program.Main(String[] args)

Strace shows it trying to access /usr/lib/ssl/ stuff which doesn't exist in the environment I run it in. After that it tries to access ~/.dotnet/corefx/cryptography/x509stores/ which also doesn't (and probably shouldn't need to) exist.

In the FHS-compliant container I run Beataroni in, the directory with the files it's trying to find is /etc/ssl/. Arch puts it there too, so it's not just my usually very non-standard distro ;)

According to this, Ubuntu defaults to the /usr location for some reason but vanilla libressl defaults to the /etc one AFAICT.

geefr commented 3 years ago

Oh fun, I was hoping to avoid this kind of thing by using .net and the latest release being 'cross platform'. Guess that still means Windows + Microsoft's definition of Linux as just 'the server'.

At least according to this libressl isn't supported at all: https://github.com/dotnet/runtime/issues/24869

Thanks for raising this, call it backlogged and I'll add some workarounds in when there's time, likely a checkbox or something that just bypasses the validation (Assuming I have that kind of control).

ominitay commented 3 years ago

Embrace, extend, extinguish ;)

Atemu commented 3 years ago

Maybe you could create an AppImage with M$-blessed libraries?

I'll also have a look into hacking around this issue on and perhaps even packaging Beataroni for my distro; we have some dotnet infrastructure AFAICT.

geefr commented 3 years ago

Maybe, but I'd probably have to package a whole ubuntu runtime into it..

Think an easier option would be to avoid using the stock .net http lib, and substitute something else, maybe a wrapper around libcurl if one exists.

While I'm not surprised at all by Microsoft's approach here I'm surprised there's not some big flashing warning on anything I've read about linux support yet. All I knew of was the lack of official UI libraries, hence the use of Avalonia.

I'll take a look when I can (Likely the weekend, day job has restarted). Until then I'll say Beataroni supports anything that .net 5.0 does, so libressl systems aren't strictly supported yet ;)

Workarounds would be to use qbeat, or bug @Ominitay about the new shell-based installer. If you're building some package for modded beatsaber that might be a more unixy approach to the problem.

geefr commented 3 years ago

@Atemu Okay it may not be as simple as not having the files in /usr/lib/ssl. Ran up a Manjaro VM (openssl, but only files in /etc/ssl) and things work correctly.

So the next thing I need to test is a distro that only has libressl - So far I can't find one that's setup out of the box (And I failed the arch installation guide very quickly).

Can you provide instructions for reproducing the error? should be able to debug from there. I've got various hypervisors/docker hosts available, so should be able to setup any environment.

steffenWi commented 3 years ago

I had a feeling on this so I checked and found this issue report. Long story short, libressl is not supported by dotnet core.

Found an easy workaround in one of the linked issues though: https://github.com/dotnet/core/issues/4749

geefr commented 3 years ago

The symlink? Yeah it'll work (Until libre/open ssl have an ABI difference...)

In that case I'm closing this one, happy to merge workarounds into beataroni if they can be done in a sane way.

Atemu commented 3 years ago

Adding openssl to the FHSEnv does indeed solve the problem and the Beataroni binary works as expected.

Also finally found out why mods weren't working, the ancient Proton version Steam defaults to for BS was the cause.

Anything I should know before packaging it?

geefr commented 3 years ago

Only packaging advice is that packaging bugs are yours ;)

I'd certainly recommend the latest proton (5.x?) regardless of whether the mods work, there's been big improvements to VR in general.

Thanks for investigating and your efforts on packaging