Bug 203528 - www/node: Add option to use system OpenSSL
Summary: www/node: Add option to use system OpenSSL
Status: Closed DUPLICATE of bug 209793
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Adam Weinberger
URL:
Keywords: patch
: 203527 (view as bug list)
Depends on: 209793
Blocks:
  Show dependency treegraph
 
Reported: 2015-10-03 17:51 UTC by Adam Weinberger
Modified: 2016-05-27 20:44 UTC (History)
2 users (show)

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


Attachments
BUNDLED_SSL option (8.72 KB, patch)
2015-10-03 17:52 UTC, Adam Weinberger
no flags Details | Diff
BUNDLED_SSL option (updated) (8.75 KB, patch)
2016-03-04 17:56 UTC, Adam Weinberger
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Weinberger freebsd_committer freebsd_triage 2015-10-03 17:51:33 UTC
node comes with its own OpenSSL library, but some of us would prefer to be using one OpenSSL library across the board.

The attached patch adds a BUNDLED_SSL option that uses a shared OpenSSL library. Currently it requires a version from ports (build fails against the base OpenSSL on 9 and 10-stable).
Comment 1 Adam Weinberger freebsd_committer freebsd_triage 2015-10-03 17:52:07 UTC
Created attachment 161683 [details]
BUNDLED_SSL option
Comment 2 Adam Weinberger freebsd_committer freebsd_triage 2015-10-03 18:25:13 UTC
*** Bug 203527 has been marked as a duplicate of this bug. ***
Comment 3 Adam Weinberger freebsd_committer freebsd_triage 2016-03-04 17:56:36 UTC
Created attachment 167724 [details]
BUNDLED_SSL option (updated)

Updated patch against latest www/node
Comment 4 Adam Weinberger freebsd_committer freebsd_triage 2016-03-04 17:59:44 UTC
Can you please take another look at this PR? It builds perfectly on 9 and 10, and every SSL test I've run works perfectly. OS X Homebrew builds with this change enabled as default.

Given the frequency of OpenSSL-related exploits, we really, really should be providing a way for people to link their own OpenSSL version.

root@lockup:/wrkdirs/usr/ports/www/node/work # ldd /usr/local/bin/node | egrep 'ssl|crypto'
        libcrypto.so.8 => /usr/local/lib/libcrypto.so.8 (0x80153c000)
        libssl.so.8 => /usr/local/lib/libssl.so.8 (0x801949000)
Comment 5 linpct 2016-03-17 04:33:15 UTC
Maintainer approved, please check if this patch could apply to node 5.8.0.

Thanks.
Comment 6 Bradley T. Hughes freebsd_committer freebsd_triage 2016-04-15 07:26:51 UTC
The patch doesn't apply cleanly anymore, so it'll need updating. What about the other node ports, might be nice to do them all at the same time?
Comment 7 Adam Weinberger freebsd_committer freebsd_triage 2016-04-15 14:27:00 UTC
Hey Bradley, sorry I didn't update this PR earlier.

Node does not build against any current version of LibreSSL.

This patch would need to do something like what ftp/curl does for the TLS_SRP option---print a message and error out if LibreSSL is the library being linked against.
Comment 8 Bradley T. Hughes freebsd_committer freebsd_triage 2016-04-19 10:45:35 UTC
I wasn't thinking about libressl, but rather about the other www/node* ports. I went ahead and updated your patch and adapted it for all 4 ports. See https://github.com/bradleythughes/freebsd-ports/commit/b292974aaa3a824af797f710f312b025f4abb6a9

:)
Comment 9 Adam Weinberger freebsd_committer freebsd_triage 2016-04-19 13:55:27 UTC
Your updated patch looks great, but it will still break when LibreSSL is installed. It needs to identify that case and produce a helpful message.
Comment 10 Bradley T. Hughes freebsd_committer freebsd_triage 2016-04-20 08:04:03 UTC
That is true. Looking through various discussions in issues and pull requests for node.js on Github, I see that LibreSSL support isn't a priority or a concern. I am not sure how we can address/communicate this in the port if the user has  OPENSSL_PORT=security/libressl in their local make.conf.
Comment 11 Adam Weinberger freebsd_committer freebsd_triage 2016-04-20 12:41:01 UTC
ftp/curl does something similar. Check out https://svnweb.freebsd.org/ports/head/ftp/curl/Makefile?r1=382459&r2=382461
Comment 12 Bradley T. Hughes freebsd_committer freebsd_triage 2016-05-27 13:23:48 UTC
I just submitted a new PR with patch to unconditionally use external dependencies where possible, including openssl. See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=209793

The porters handbook and general consensus is that these shouldn't be options. That PR makes this one unnecessary.
Comment 13 Adam Weinberger freebsd_committer freebsd_triage 2016-05-27 20:44:46 UTC
Closing this PR. A better plan was introduced by maintainer in bug #209793.

*** This bug has been marked as a duplicate of bug 209793 ***