Bug 229119 - lang/ruby25: OpenSSL broken
Summary: lang/ruby25: OpenSSL broken
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-ruby (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-06-18 18:00 UTC by ncrogers
Modified: 2018-08-15 18:25 UTC (History)
4 users (show)

See Also:
bugzilla: maintainer-feedback? (ruby)


Attachments
Fix openssl ext behavior with OpenSSL 1.0 (2.96 KB, patch)
2018-07-15 13:31 UTC, Thibault Jouan
no flags Details | Diff
Fix openssl ext behavior with OpenSSL 1.0 (3.41 KB, patch)
2018-07-15 14:50 UTC, Thibault Jouan
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description ncrogers 2018-06-18 18:00:08 UTC
I experience "Undefined symbol "EVP_PKEY_get0_RSA" errors with this port because of the patch that was committed in r465590. Removing files/patch-ext_openssl_openssl__missing.h from the port fixes the problem for me. I am compiling against OpenSSL in base.

OpenSSL 1.0.2k-freebsd  26 Jan 2017
# ruby -v
ruby 2.5.1p57 (2018-03-29 revision 63029) [amd64-freebsd11]
# irb
irb(main):001:0> require 'openssl'; OpenSSL::PKey::RSA.new(`openssl genrsa`).private_encrypt('foo')
Generating RSA private key, 2048 bit long modulus
.....+++
...............................................................+++
e is 65537 (0x10001)
/usr/local/lib/ruby/2.5/amd64-freebsd11/openssl.so: Undefined symbol "EVP_PKEY_get0_RSA"

This is related to bug 226852 (https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=226852) - the fix for it was committed upstream and now causes this bug.
Comment 1 Thibault Jouan 2018-07-15 13:31:31 UTC
Created attachment 195147 [details]
Fix openssl ext behavior with OpenSSL 1.0

  This patch should fix runtime behavior with both OpenSSL from base and from
security/openssl port (broken since ports r465590, bug #226852).

  Current status, without this patch:

ssl=base            runtime behavior is broken
ssl=openssl         runtime behavior is broken
ssl=openssl-devel   does not build
ssl=libressl        OK
ssl=libressl-devel  OK

  After applying the patch:

ssl=base            OK
ssl=openssl         OK
ssl=openssl-devel   does not build
ssl=libressl        OK
ssl=libressl-devel  OK

  I'm not sure yet why I can't build against openssl-devel, but I've been using
this patch with ssl=openssl since a few months and didn't notice any particular
problem. I just checked again that it still allow building with
ssl=libressl-devel, and seems to run fine.
Comment 2 Thibault Jouan 2018-07-15 14:50:41 UTC
Created attachment 195149 [details]
Fix openssl ext behavior with OpenSSL 1.0

  Updated patch to be more similar to the one for lang/ruby24: ports r471799,
reported in bug 227851.

  Alternatively, we can just remove patch added in ports r465590 and copy the
one from lang/ruby24:

svn rm lang/ruby25/files/patch-ext_openssl_openssl__missing.h
cp lang/ruby24/files/patch-ext-openssl-extconf.rb lang/ruby25/files
svn add lang/ruby25/files/patch-ext-openssl-extconf.rb
Comment 3 commit-hook freebsd_committer freebsd_triage 2018-08-15 18:24:33 UTC
A commit references this bug:

Author: swills
Date: Wed Aug 15 18:23:46 UTC 2018
New revision: 477249
URL: https://svnweb.freebsd.org/changeset/ports/477249

Log:
  lang/ruby25: Fix with ports OpenSSL and LibreSSL

  PR:		229119
  PR:		226852
  Submitted by:	Thibault Jouan <tj+freebsd_ports@a13.fr>
  Reported by:	Piotr Kubaj <pkubaj@anongoth.pl>
  With hat:	ruby@

Changes:
  head/lang/ruby25/files/patch-ext-openssl-extconf.rb
  head/lang/ruby25/files/patch-ext_openssl_openssl__missing.h
Comment 4 Steve Wills freebsd_committer freebsd_triage 2018-08-15 18:25:32 UTC
Committed, thanks!