Skip to content

Conversation

CL-Jeremy
Copy link
Contributor

@CL-Jeremy CL-Jeremy commented Sep 17, 2025

Description

  • Add (currently experimental) OpenSSL support as variant
    • Notice on extra constraints with this backend in the readme document on upstream
    • Less useful for existing packages, which often demands GnuTLS backend
  • Add wolfSSL backend
  • Make GnuTLS an optional backend (but a default one as it remains the most popular choice for many programs)

I'm doing this mainly for my samba4 port. Will follow up on curl, which supports the other backends (except Picotls, but since it supports OpenSSL, one could do port install ngtcp2 -- -gnutls +openssl +picotls). Will see if more ports are affected.

Type(s)
  • bugfix
  • enhancement
  • security fix
Tested on

macOS 10.15.7 19H2026 x86_64
Command Line Tools 12.4.0.0.1.1610135815

Verification

Have you

  • followed our Commit Message Guidelines?
  • squashed and minimized your commits?
  • checked that there aren't other open pull requests for the same change?
  • referenced existing tickets on Trac with full URL in commit message?
  • checked your Portfile with port lint?
  • tried existing tests with sudo port test?
  • tried a full install with sudo port -vst install?
  • tested basic functionality of all binary files?
  • checked that the Portfile's most important variants haven't been broken?

@macportsbot
Copy link

Notifying maintainers:
@barracuda156 for port ngtcp2.

--with-gnutls=yes

variant openssl description "Enable OpenSSL" {
depends_lib-append port:openssl3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be here, PortGroup already adds the dependency.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, I suppose I need to either do openssl.branch no_version as with php* port, or remove PortGroup openssl 1.0 as with curl?

Copy link
Contributor

@barracuda156 barracuda156 Sep 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why though? If you want to use openssl3, just keep the PG. If configure does not find it, then check the portgroup file for related variables.

P. S. You could move the PG inside the variant, if it is not used otherwise. (I do not remember now if it was needed or remained as an artifact.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me first try dropping it entirely. Semantically it doesn't make sense if OpenSSL isn't even needed in the default case.

variant openssl description "Enable OpenSSL" {
depends_lib-append port:openssl3
configure.args-append \
--with-openssl=yes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to make sure, can openssl and gnutls be used here simultaneously?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Except those cases stated explicitly in the readme file (https://github.com/ngtcp2/ngtcp2?tab=readme-ov-file#crypto-helper-library), crypto library backends could coexist and are only leveraged when linked specifically by a program.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use it by default then? Or the variant is still justified?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As stated in the PR's description, support for OpenSSL is very new and has limitations not present in other backends, meaning that current programs cannot be easily migrated and new programs must meet those extra conditions. AFAIK neither Fedora Rawhide nor Debian Sid ship this backend, but I do see its value. Maybe even GnuTLS could be made as a variant (still the default one, though) so those who prefer dropping it could do so.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, do what you consider useful, I will test it on my end. And thank you for improving the port!

@CL-Jeremy
Copy link
Contributor Author

Added patch for detecting vanilla OpenSSL (for use with Picotls) without actually building the OpenSSL backend (for the Automake build process, with CMake it should behaves like this already). Patch already submitted to upstream.

@barracuda156
Copy link
Contributor

barracuda156 commented Sep 18, 2025

@CL-Jeremy Does building recent versions of picotls work for you btw? I tried to upgrade it a few times, but every time it was broken. The latest issue being h2o/picotls#537

@CL-Jeremy CL-Jeremy mentioned this pull request Sep 19, 2025
9 tasks
@CL-Jeremy CL-Jeremy marked this pull request as draft September 24, 2025 09:39
--with-wolfssl=yes
}

variant picotls description "Enable Picotls backend" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@CL-Jeremy This seems to imply that +picotls requires +openssl as well: ngtcp2/ngtcp2#1789 (comment)

Copy link
Contributor Author

@CL-Jeremy CL-Jeremy Sep 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, the patch (already accepted by upstream) deals with exactly this. With this patch (or using upstream 1.16+), it merely checks for vanilla OpenSSL and will proceed to build Picotls backend regardless of QUIC support inside OpenSSL (which is determined along with LibreSSL, wolfSSL and QuicTLS, just enabling Picotls by itself skips these checks). Of course, OpenSSL would be needed as a dependency build dependency (Picotls is currently only built statically, Picotls upstream has plans, but dynamic libs are not yet ready) in this case.

Oh and by the way, how does PortGroup openssl handle build deps? Picotls should not need OpenSSL at runtime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

3 participants