2

I'm trying to develop .NET Core in openSuse. I did install the SDK and everything in tutorials. Now, when I try to run dotnet new console command, I get this error:

No usable version of the libssl was found

Aborted (core dumped)

I found this answer: (.NET Core 2.1 SDK Linux x64 No usable version of the libssl was found), but didn't get what should I do to solve problem. They seems are deep-linuxer (which I'm not, I'm just trying to learn linux). Have any idea how to run the command?

UPDATE: System info:

openSUSE Leap 15.0

Kernel Version 4.12.14-lp150.12.22-default

OS Type:64-bit

amiry jd
  • 27,021
  • 30
  • 116
  • 215
  • What's the version number of your openSUSE installation? https://software.opensuse.org/package/openssl – Lex Li Nov 04 '18 at 15:49
  • @LexLi I added the system info to question. But the `openssl` is already installed. It seems `dotnet` cannot find it. – amiry jd Nov 04 '18 at 16:21

5 Answers5

7

I was having the same problem running sqlpackage on Ubuntu 20.04 while dotnet was working regularly.

dotnet is distributed through apt as well as sqlserver, but for some reasons sqlpackage is instead distributed via zip here (https://learn.microsoft.com/en-us/sql/tools/sqlpackage-download?view=sql-server-ver15) and is still affected by missing libssl1.0.

Solved with

wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl1.0/libssl1.0.0_1.0.2n-1ubuntu5.6_amd64.deb
sudo dpkg -i libssl1.0.0_1.0.2n-1ubuntu5.6_amd64.deb
Francesco
  • 71
  • 1
  • 3
  • 1
    That helped me. openssl was already installed but not used by .net. A sugestion : add "sudo" on second line so people can just copy paste :) – Jurion Jul 25 '20 at 18:05
  • 1
    This helped me too but the URL has changed now please use the following URL `wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl1.0/libssl1.0.0_1.0.2n-1ubuntu5.5_amd64.deb` and then `sudo dpkg -i libssl1.0.0_1.0.2n-1ubuntu5.5_amd64.deb` – yodellingbutters Jan 25 '21 at 09:16
  • Helped me too! I was trying to [build sqlpackage linux image](https://github.com/ormico/sqlpackage-docker,) got ```No usable version of the libssl was found```. – bitmountain Feb 19 '21 at 11:38
  • 1
    @Francesco The URL return 404. I believe now you should `wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl1.0/libssl1.0.0_1.0.2n-1ubuntu5.6_amd64.deb` and then `sudo apt install ./libssl1.0.0_1.0.2n-1ubuntu5.6_amd64.deb` – nkalfov Jun 13 '21 at 10:51
6

Can you install the libopenssl1_0_0 packages? .NET Core should pick it up and use it.

A slightly longer explanation for anyone who is curious:

OpenSSL is one of the most common cryptographic libraries used on Linux. It has multiple versions. Version 1.0 is kind of old, but heavily used. 1.1 is the newer version that was (relatively) recently released. 1.0 and 1.1 are not compatible. An application that expects 1.0 can not build against 1.1, nor run against it.

.NET Core 2.1, and all earlier versions only support OpenSSL 1.0.

Many Linux distributions are starting to make OpenSSL 1.1 the new default. But most of them still have a package for 1.0. So you just need to find and install that. On Fedora it's compat-openssl10. For openSuSE, it's libopenssl1_0_0. Then .NET Core will find it, pick it up and use it automatically.

Edit: As of March 2019, this shouldn't be required. We have updated .NET Core 2.1 and later to pick up and work with either OpenSSL 1.1 or 1.0 (whatever is available). So this problem should no longer happen with recent releases of .NET Core.

omajid
  • 14,165
  • 4
  • 47
  • 64
4

Ubuntu 22.04

wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl1.0/libssl1.0.0_1.0.2n-1ubuntu5_amd64.deb

sudo dpkg -i libssl1.0.0_1.0.2n-1ubuntu5_amd64.deb

vadim_au
  • 41
  • 2
1

Still get this on Fedora 30 (with compat-openssl10 installed) when using the sqlpackage tool (https://learn.microsoft.com/en-us/sql/tools/sqlpackage-download?view=sql-server-2017).

$ dotnet --info
.NET Core SDK (reflecting any global.json):
 Version:   2.2.203
 Commit:    e5bab63eca

Runtime Environment:
 OS Name:     fedora
 OS Version:  30
 OS Platform: Linux
 RID:         linux-x64
 Base Path:   /usr/share/dotnet/sdk/2.2.203/

Host (useful for support):
  Version: 2.2.4
  Commit:  f95848e524

.NET Core SDKs installed:
  2.2.203 [/usr/share/dotnet/sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.2.4 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.2.4 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.2.4 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download

Dotnet works fine on it's own. But running sqlpackage does not work:

$ sqlpackage /tsn:localhost /tu:xx /tp:yyy /A:Import /tdn:mydb /sf:mydb.bacpac
Importing to database 'mydb' on server 'localhost'.
No usable version of the libssl was found
Aborted (core dumped)
Paaland
  • 682
  • 1
  • 10
  • 25
-1

I looking up "No usable version of the libssl was found" in github. You'll find many variants of the .Net core security library in C, each varient has very specific dll loads for exact libssl libraries and everything has to match perfect despite it being named differently in many.

For raspberry pi / debian it wants libssl 1.0.2 exactly, nothing else.

sudo apt-get install libssl1.0.2

should do the trick for the pi! I can't speak to other variants.

BrewCode
  • 1
  • 1
  • This doesn't work. It installs, .netcore application starts up and works, but as soon as you make an SSL connection it will throw an `HttpRequestException` with message being "The SSL Connection could not be established" and tons of information in the inner exception about why. – Andy Mar 09 '20 at 21:04