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

Error when installing openssl version 1.0 (MacOS Big Sur, Version 11.7.6. i7) #9

Closed
Victorcorcos opened this issue Jul 13, 2023 · 8 comments · Fixed by #2
Closed

Error when installing openssl version 1.0 (MacOS Big Sur, Version 11.7.6. i7) #9

Victorcorcos opened this issue Jul 13, 2023 · 8 comments · Fixed by #2

Comments

@Victorcorcos
Copy link

Victorcorcos commented Jul 13, 2023

Versions ⚙️

  • Operational System
Screen Shot 2023-07-13 at 05 57 49
  • Xcode
$ /usr/bin/xcodebuild -version

Xcode 13.2.1
Build version 13C100
  • Homebrew
$ brew -v 

Homebrew 4.0.28
Homebrew/homebrew-core (git revision 0d808134053; last commit 2023-03-23)
Homebrew/homebrew-cask (git revision 378b3a7cb6; last commit 2023-03-24)

Description 📖

My main intention is just to install Ruby version 3.2.2. However, there is an issue with that. When executing the rvm install "ruby-3.2.2" command, there is a problem with openssl.

Screen Shot 2023-07-05 at 21 20 20

  • make.log
[2023-07-13 00:41:25] __rvm_make
__rvm_make () 
{ 
    \make "$@" || return $?
}

[...]

In file included from ossl_engine.c:10:
In file included from ./ossl.h:177:
./openssl_missing.h:195:11: warning: 'TS_VERIFY_CTS_set_certs' macro redefined [-Wmacro-redefined]
#  define TS_VERIFY_CTS_set_certs(ctx, crts) ((ctx)->certs=(crts))
          ^
/usr/local/Cellar/openssl@3/3.1.1_1/include/openssl/ts.h:426:11: note: previous definition is here
#  define TS_VERIFY_CTS_set_certs(ctx, cert) TS_VERIFY_CTX_set_certs(ctx,cert)
          ^
1 warning generated.
compiling ossl_kdf.c
installing default ripper libraries
compiling strscan.c
In file included from ossl_hmac.c:10:
In file included from ./ossl.h:177:
./openssl_missing.h:195:11: warning: 'TS_VERIFY_CTS_set_certs' macro redefined [-Wmacro-redefined]
#  define TS_VERIFY_CTS_set_certs(ctx, crts) ((ctx)->certs=(crts))
          ^
/usr/local/Cellar/openssl@3/3.1.1_1/include/openssl/ts.h:426:11: note: previous definition is here
#  define TS_VERIFY_CTS_set_certs(ctx, cert) TS_VERIFY_CTX_set_certs(ctx,cert)
          ^
ossl_hmac.c:249:35: error: incomplete definition of type 'struct evp_md_ctx_st'
    pkey = EVP_PKEY_CTX_get0_pkey(EVP_MD_CTX_get_pkey_ctx(ctx));
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
./openssl_missing.h:230:41: note: expanded from macro 'EVP_MD_CTX_get_pkey_ctx'
#  define EVP_MD_CTX_get_pkey_ctx(x) (x)->pctx
                                     ~~~^
/usr/local/Cellar/openssl@3/3.1.1_1/include/openssl/types.h:107:16: note: forward declaration of 'struct evp_md_ctx_st'
typedef struct evp_md_ctx_st EVP_MD_CTX;
               ^
1 warning and 1 error generated.
make[2]: *** [ossl_hmac.o] Error 1
make[2]: *** Waiting for unfinished jobs....
compiling constants.c
compiling basicsocket.c
In file included from ossl_kdf.c:5:
In file included from ./ossl.h:177:
./openssl_missing.h:195:11: warning: 'TS_VERIFY_CTS_set_certs' macro redefined [-Wmacro-redefined]
#  define TS_VERIFY_CTS_set_certs(ctx, crts) ((ctx)->certs=(crts))
          ^
/usr/local/Cellar/openssl@3/3.1.1_1/include/openssl/ts.h:426:11: note: previous definition is here
#  define TS_VERIFY_CTS_set_certs(ctx, cert) TS_VERIFY_CTX_set_certs(ctx,cert)
          ^
1 warning generated.
make[1]: *** [ext/openssl/all] Error 2
make[1]: *** Waiting for unfinished jobs....
compiling socket.c
linking shared-object strscan.bundle
linking shared-object nkf.bundle
compiling ipsocket.c
compiling tcpsocket.c
compiling tcpserver.c
linking shared-object stringio.bundle
compiling sockssocket.c
compiling udpsocket.c
compiling unixsocket.c
compiling unixserver.c
compiling option.c
compiling ancdata.c
compiling raddrinfo.c
compiling ifaddr.c
installing default socket libraries
linking shared-object socket.bundle
linking shared-object date_core.bundle
linking shared-object ripper.bundle
make: *** [build-ext] Error 2
++ return 2

In order to fix this, one of the recommended options was to downgrade openssl and install it's version 1.0. However, when trying to install openssl@1.0 via brew install rbenv/tap/openssl@1.0, this error was generated.

Error Log 📎

$ brew install rbenv/tap/openssl@1.0

==> Tapping rbenv/tap
Cloning into '/usr/local/Homebrew/Library/Taps/rbenv/homebrew-tap'...
remote: Enumerating objects: 5, done.
remote: Counting objects: 100% (5/5), done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 5 (delta 0), reused 5 (delta 0), pack-reused 0
Receiving objects: 100% (5/5), done.
Tapped 1 formula (13 files, 9.9KB).
==> Downloading https://formulae.brew.sh/api/cask.jws.json
############################################################################################################################################################### 100.0%
==> Fetching rbenv/tap/openssl@1.0
==> Downloading https://www.openssl.org/source/openssl-1.0.2t.tar.gz
############################################################################################################################################################### 100.0%
==> Installing openssl@1.0 from rbenv/tap
Warning: Your Xcode (13.0) is outdated.
Please update to Xcode 13.2.1 (or delete it).
Xcode can be updated from the App Store.

==> Downloading https://formulae.brew.sh/api/formula.jws.json
############################################################################################################################################################### 100.0%
==> perl ./Configure --prefix=/usr/local/Cellar/openssl@1.0/1.0.2t --openssldir=/usr/local/etc/openssl no-ssl2 no-ssl3 no-zlib shared enable-cms darwin64-x86_64-cc en
==> make depend
say ok
==> make
==> make test
Last 15 lines from /Users/victorcosta/Library/Logs/Homebrew/openssl@1.0/04.make:
g = 2
Salt = 935C2E280364A10401752F6AE37C2CF0598D33F0
Verifier = 752549D49E60C06BE920DE62FFBFD1C0FFB17145B25B9B4E297C99FE31A8720B628C1D829D8E673D7396C2170889D0A40F8FDAAD027625664016738FD3BF1EC961E7CA80DA3780425F78E1A18B3F4BDE88C45327E92F0F5C3591B9559C2BAECAB70B30CBAD3AB960DBC9A94694F19CE480E3BA92A5627A4F571645F62DEBD501
b = 73DF2815F6FAEB934B9DB3F5085F10CBE40E58800D303ED6EC1FA58F94ADB4FB
B = 3832C1C5008857EEE741BB46C2197918853671EF9A17331BC35647144AF0764A933A6FA7D5BE6C72A6D79E1DC45FC261B77B503E7B770F8D8A7CEE5B40687D8E3E441320D63C46568FF5E9DC9C0F503DDF5ADA8A81C544FC392E9631837B1E33C034239F15E6ED8D622C30A755CC5B8FBF148065FACA7E574B641FD0D30C6ECE
a = 5C1905906B996EB464C393B1E8DCAD4A793CC20FD85156225AAEB2B6BEC51112
A = C3368B4F5AAE1FB7EC77891E5799FD76CEE63657DC996F11025810C7873A15DBE657251F97BD9EEFE871C9A3FBB67C0D7B7A21D5A806ED64069C57594293019523034EF9F517CB213081DA4E6AA0392E1371ECD9AEA54978E109C2F75B611C9F969195CB023ECFFD96FA5FAE735915F5B78B574A63BFC806861BBC708762477B
Client's key = 3A2202FAADBACC7A1636D1109D190DA682BD92A72CD2E592B9A34E73EE87490A852A63EF6E75610C956D653DBD8E76E01F562F81B994A00F34D1728441DAADDDA0C3464E7C53D0F9DC5E10010D946F6ECB5D549538298915B9CC743617715FC49F227FC5F030B82E0696FF1CC92A4B7A21C7162016751AA0579EDA5C24FCAD63
Server's key = 3A2202FAADBACC7A1636D1109D190DA682BD92A72CD2E592B9A34E73EE87490A852A63EF6E75610C956D653DBD8E76E01F562F81B994A00F34D1728441DAADDDA0C3464E7C53D0F9DC5E10010D946F6ECB5D549538298915B9CC743617715FC49F227FC5F030B82E0696FF1CC92A4B7A21C7162016751AA0579EDA5C24FCAD63
CMS consistency test
/usr/bin/perl cms-test.pl
CMS => PKCS#7 compatibility tests
signed content DER format, RSA key: verify error
make[1]: *** [test_cms] Error 1
make: *** [tests] Error 2

If reporting this issue please do so at (not Homebrew/brew or Homebrew/homebrew-core):
  https://github.com/rbenv/homebrew-tap/issues

These open issues may also help:
`brew install rbenv/tap/openssl@1.0` not working anymore https://github.com/rbenv/homebrew-tap/issues/1
@alexventuraio
Copy link

I confirm I do have the exact same error when trying to install Ruby 3.2.2:

  • Mac OS Ventura 13.2.1 (22D68)
  • Apple M1 Pro
  • Homebrew 4.1.0
  • OpenSSL 3.1.1 30 May 2023 (Library: OpenSSL 3.1.1 30 May 2023)

@Victorcorcos any progress on fixing it?

@alexventuraio
Copy link

I got Ruby 3.2.2 installed by downgrading OpenSSL to v1.1

brew install openssl@1.1
brew list    # just to make sure we have it installed
brew unlink openssl@3
brew link openssl@1.1

# ...

openssl version
# OpenSSL 1.1.1u  30 May 2023

rvm install 3.2.2   # all good now! :)

@melsner11
Copy link

I was reading this article and following step should solve the issue with ssl

  • brew install openssl@3
  • ruby-install 3.1.4 -- --with-openssl-dir=$(brew --prefix openssl@3)
  • chruby 3.1.4

@xguz
Copy link

xguz commented Aug 17, 2023

Here's what worked for me with RVM:
brew install openssl@3
rvm install 3.2.2 --with-openssl-dir=$(brew --prefix openssl@3)

@ladar
Copy link

ladar commented Sep 22, 2023

Not sure if the bug is fixed already, but I noticed a couple of other related issues. so I'm posting a note on the issue anywats. Check out my explanation here:

The certs embedded in the tarball and used by the unit tests expired. You can find patches for 1.02 and 1.1.1 here: There is a patch for 3.1.1 floating around as well if someone needs it.

1.1.1_update_expiring_certificates.patch

1.0.2_update_expiring_certificates.patch

I only tweaked the alignment of the 1.1.1 patch so it would line up and apply to 1.0.2 without complaint. I would post a link to the original 1.1.1 patch but I don't have it handy.

All these patches do is update the shell script used to make those test certs. The developer ran the updated script and generated new dummy test certs, and the remaining bits are used to update the certs themselves.

@nroose
Copy link

nroose commented Oct 5, 2023

Installing Ruby 3.2.2 using rvm kept installing openssl@1.1 using brew, even though I have openssl@3, and it kept getting the error. Then I ran

rvm install 3.2.2 --with-openssl-dir=$(brew --prefix openssl@1.1)

and it worked.

@obromios
Copy link

I had this error installing ruby 3.2.3. I had already installed openssl@3 so this fixed it for me

rvm install 3.2.3 --with-openssl-dir=$(brew --prefix openssl@3)

@mislav
Copy link
Member

mislav commented Feb 23, 2024

Just because people keep finding this thread via web searches and misunderstand the purpose of this repository:

This repository, and all issues in it, are only about setting up a workaround to install openssl@1.0 via Homebrew, which is an ancient, unsupported version of OpenSSL that is unfortunately necessary for installing some older Ruby versions (e.g. Ruby 2.3 or older).

Any later version of OpenSSL, such as openssl@1.1 or openssl@3, should be easily installable via Homebrew without any special workarounds (although keep in mind that the openssl@1.1 formula is already deprecated). Discussions around those, including how to configure RVM, are outside the scope of this repository.

That said, thanks everyone for sharing what worked for you!

@rbenv rbenv locked as resolved and limited conversation to collaborators Feb 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants