Opened 14 months ago

Closed 13 months ago

Last modified 13 months ago

#66992 closed defect (fixed)

mssql-tools @17.7.1.1: OpenSSL library could not be loaded, make sure OpenSSL 1.0 or 1.1 is installed

Reported by: zoonman (Philipp) Owned by: roederja
Priority: Normal Milestone:
Component: ports Version: 2.8.1
Keywords: bigsur Cc:
Port: mssql-tools

Description

Hi guys, the port seems to be installed correctly but it doesn't work.

Initially I started with python odbc but I ended up with isql as python issues is a mere reflection of a real problem under the hood:

isql -v -k 'DRIVER={ODBC Driver 17 for SQL Server};SERVER=127.0.0.1,1433;trusted_connection=no;UID=sa;PWD=password'

[08001][Microsoft][ODBC Driver 17 for SQL Server]SSL Provider: [OpenSSL library could not be loaded, make sure OpenSSL 1.0 or 1.1 is installed]
[08001][Microsoft][ODBC Driver 17 for SQL Server]Client unable to establish connection
[ISQL]ERROR: Could not SQLDriverConnect

It seems like it depends on openssl but it is not marked as directly relevant.

Versions:

  • macports @ 2.8.1
  • msodbcsql17 @ 17.7.1.1_1
  • mssql-tools @ 17.7.1.1_0
  • unixODBC @ 2.3.9_0

I tired installing openssl but it didn't address the issue. It seems like it is inside msodbcsql17 but I cannot speak for sure. I need help here.

Maybe this will help:

port installed openssl*

The following ports are currently installed:
  openssl @3_9 (active)
  openssl3 @3.0.8_1+legacy (active)
  openssl10 @1.0.2u_4 (active)
  openssl11 @1.1.1t_0 (active)

Change History (11)

comment:1 Changed 14 months ago by ryandesign (Ryan Carsten Schmidt)

Keywords: mssql odbc removed
Owner: set to roederja
Status: newassigned
Summary: mssql-tools 17.7 has broken link to opensslmssql-tools @17.7.1.1: OpenSSL library could not be loaded, make sure OpenSSL 1.0 or 1.1 is installed

comment:2 Changed 13 months ago by kiwiroy (Roy Storey)

With openssl11 installed this workaround enables connection with isql.

env DYLD_LIBRARY_PATH=/opt/local/lib/openssl-1.1  isql -v -k ...

comment:3 Changed 13 months ago by neverpanic (Clemens Lang)

This is one of the reasons why don't typically package binaries in MacPorts—you can't fix them to actually work with the system.

Since you as the maintainer have done so anyway, I'd propose that you modify the msodbcsql17 (a) add a dependency on the openssl11 port, since that seems to be required, and (b) add a note to the port telling users to export DYLD_FALLBACK_LIBRARY_PATH=/opt/local/libexec/openssl11/lib when they use the driver.

comment:4 Changed 13 months ago by kiwiroy (Roy Storey)

With openssl11 installed adding a symlink results in loading the correct openssl object.

/usr/local/opt/openssl/lib -> /opt/local/lib/openssl-1.1
> strings /opt/local/lib/libmsodbcsql.17.dylib | grep openssl
/usr/local/opt/openssl/lib/

comment:5 Changed 13 months ago by roederja

This issue has come up before and I thought a note about the need to add a symlink had already been added. What’s new is that we now need OpenSSL 1.1 explicitly. I remember that the path is hardcoded into the binary, so I was surprised to see that you seem to have gotten it to work with the env variable which is a bit cleaner. But then in your PR you added the note about the symlink. I’ll have a look later today when I get home.

Last edited 13 months ago by roederja (previous) (diff)

comment:6 Changed 13 months ago by kiwiroy (Roy Storey)

roederja for version 17.7.1.1 the path is hardcoded AFAICT. The environment variable only worked for isql and not when using ODBC from my program.

The latest version from Microsoft in the 17 series is 17.10.2.1. From opensnoop logging appears to use openssl3, though still searches /usr/local/opt/openssl/lib first

2023 Mar 29 10:45:56 695855688  13398 perl          -1 /usr/local/opt/openssl/lib/libcrypto.3.dylib 
2023 Mar 29 10:45:56 695855688  13398 perl          -1 /usr/local/opt/openssl/lib 
2023 Mar 29 10:45:56 695855688  13398 perl          -1 /usr/local/opt/openssl/lib/libcrypto.3.dylib 
2023 Mar 29 10:45:56 695855688  13398 perl          -1 /usr/local/opt/openssl/lib 
2023 Mar 29 10:45:56 695855688  13398 perl          -1 /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib 
2023 Mar 29 10:45:56 695855688  13398 perl          -1 /usr/local/opt/openssl/lib 
2023 Mar 29 10:45:56 695855688  13398 perl          -1 /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib 
2023 Mar 29 10:45:56 695855688  13398 perl          -1 /usr/local/opt/openssl/lib 
2023 Mar 29 10:45:56 695855688  13398 perl          -1 /usr/local/opt/openssl/lib/libcrypto.dylib 
2023 Mar 29 10:45:56 695855688  13398 perl          -1 /usr/local/opt/openssl/lib 
2023 Mar 29 10:45:56 695855688  13398 perl          -1 /usr/local/opt/openssl/lib/libcrypto.dylib 
2023 Mar 29 10:45:56 695855688  13398 perl          -1 /usr/local/opt/openssl/lib 
2023 Mar 29 10:45:56 695855688  13398 perl          11 /opt/local/lib/libcrypto.3.dylib 
2023 Mar 29 10:45:56 695855688  13398 perl          11 /opt/local/libexec/openssl3/lib/libcrypto.3.dylib 

I'll augment that PR.

comment:7 Changed 13 months ago by roederja

Look at this commit where I removed the note following the release that included the macports path: https://github.com/microsoft/homebrew-mssql-release/issues/45 . It must have stopped working because of the openssl version change.

comment:8 Changed 13 months ago by kiwiroy (Roy Storey)

PR augmented and now includes a version update for mssql-tools since that is also mentioned in this ticket.

comment:9 Changed 13 months ago by roederja

So the sym link is not needed after all? I saw you removed the note again

Last edited 13 months ago by roederja (previous) (diff)

comment:10 Changed 13 months ago by Roy Storey <kiwiroy@…>

Resolution: fixed
Status: assignedclosed

In 043677b2779e7106a2751be23acf54770632dbbb/macports-ports (master):

msodbcsql17: update version to 17.10.2.1

  • include mssql-tools update to version 17.10.1.1

Closes: #66992

comment:11 Changed 13 months ago by roederja

@Kiwiroy: Someone raied #67205 - it seems like it's now broken on arm. Do you have a way to test/fix this?

Note: See TracTickets for help on using tickets.