Skip to content

gssapi: add support for Apple GSS Framework#22052

Closed
vszakats wants to merge 28 commits into
curl:masterfrom
vszakats:applegss
Closed

gssapi: add support for Apple GSS Framework#22052
vszakats wants to merge 28 commits into
curl:masterfrom
vszakats:applegss

Conversation

@vszakats

@vszakats vszakats commented Jun 16, 2026

Copy link
Copy Markdown
Member

Add support for the native GSS Framework on Apple targets, which is
Apple's fork of Heimdal. This option allows to drop Apple's deprecated
MIT Kerberos compatibility shim "mit-krb5/1.7-prerelease".

Source code uses different headers, other than that no source changes
are necessary.

You can enable by configuring with:
autotools: --enable-gssapi-apple
CMake: -DCURL_USE_GSSAPI=ON -DCURL_GSS_FLAVOR=Apple

These options are experimental, and may receive breaking updates till
the GSS backend selection logic settles, for Apple and also for the GNU
and MIT implementation.

Version string:

curl 8.21.0-DEV (aarch64-apple-darwin25.4.0) libcurl/8.21.0-DEV
  OpenSSL/3.6.2 zlib/1.2.12 AppleIDN AppleGSS OpenLDAP/2.4.28/Apple

Also:

  • drop in-source deprecation warning suppressions when using AppleGSS.
  • GHA/macos: enable Apple GSS in CI jobs.

Supported by:
iOS 5.0+, iPadOS 5.0+, Mac Catalyst 13.0+, macOS 10.14+, visionOS 1.0+

Ref: https://developer.apple.com/documentation/gss
Ref: #19109


https://github.com/curl/curl/pull/22052/files?w=1

  • perhaps make it the default? [DO THIS ONCE IT HAS BEEN TESTED A BIT → FUTURE PR]
  • try adding support to autotools?
  • perhaps add support for MIT and GSS values for CURL_GSS_FLAVOR and the necerrary logic. [→ FUTURE PR]
  • try to untangle the 3 detections mashed up into a single Find module. [→ FUTURE PR]
    Possibly separate Find modules would be nice, with a clear way to manually enable one
    of them, or let the build pick one automatically for compatibility.

@vszakats vszakats added build cmake authentication CI Continuous Integration appleOS specific to an Apple operating system labels Jun 16, 2026
@vszakats vszakats marked this pull request as draft June 16, 2026 16:01
@vszakats vszakats added the feature-window A merge of this requires an open feature window label Jun 16, 2026
@vszakats vszakats requested a review from Copilot June 16, 2026 16:25
@vszakats vszakats changed the title gss: add support for AppleGSS gssapi: add support for AppleGSS Jun 16, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds a new CMake-selectable GSSAPI “Apple” flavor to support Apple’s native GSS framework on Apple targets, aiming to avoid the deprecated MIT Kerberos compatibility shim on macOS.

Changes:

  • Introduces HAVE_GSSAPPLE and adjusts header selection and version string reporting to identify “AppleGSS”.
  • Extends the CMake GSS detection module to accept a requested flavor and wires it through the build and exported CMake package config.
  • Updates macOS CI workflows and CMake install docs to exercise/document the new flavor knob.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
lib/version.c Adds “AppleGSS” to the curl -V feature/version string when Apple GSS is selected.
lib/vauth/spnego_gssapi.c Avoids Apple deprecation-warning suppression when building with AppleGSS.
lib/vauth/krb5_gssapi.c Same as above for Kerberos GSSAPI auth implementation.
lib/urldata.h Switches to Apple framework GSS headers when HAVE_GSSAPPLE is defined.
lib/socks_gssapi.c Avoids Apple deprecation-warning suppression when building with AppleGSS.
lib/curl_gssapi.c Avoids Apple deprecation-warning suppression when building with AppleGSS.
lib/curl_config-cmake.h.in Adds HAVE_GSSAPPLE CMake config header define.
docs/INSTALL-CMAKE.md Documents CURL_GSS_FLAVOR for selecting Apple GSS.
CMakeLists.txt Passes selected GSS flavor into find_package(GSS ...) and sets HAVE_GSSAPPLE based on detected flavor.
CMake/FindGSS.cmake Adds Apple-flavor selection support to GSS detection logic.
CMake/curl-config.in.cmake Propagates detected GSS flavor to consumers via find_dependency(GSS ...).
.github/workflows/macos.yml Enables Apple GSS flavor in macOS CI CMake jobs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread CMake/FindGSS.cmake
Comment thread docs/INSTALL-CMAKE.md Outdated
Comment thread CMakeLists.txt
vszakats added a commit that referenced this pull request Jun 16, 2026
To match the non-pkg-config path, and also suspected user expectation.

This comes with a small incompatibility in return for more consistency.

Bug: #22052 (comment)
Follow-up to 9e19a57 #15176

Closes #22053
@vszakats vszakats requested a review from Copilot June 16, 2026 17:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Comment thread CMake/FindGSS.cmake
@vszakats vszakats marked this pull request as ready for review June 16, 2026 18:12
vszakats added a commit that referenced this pull request Jun 17, 2026
@vszakats vszakats requested a review from Copilot June 17, 2026 14:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.

Comment thread configure.ac
Comment thread lib/curl_config-cmake.h.in

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.

Comment thread CMake/FindGSS.cmake
Comment on lines +72 to +76
if(GSS_FIND_COMPONENTS STREQUAL "Apple")
find_path(_gss_INCLUDE_DIRS NAMES "GSS/gssapi.h" PATH_SUFFIXES "include")
find_library(_gss_LIBRARIES NAMES "GSS")

execute_process(COMMAND ${_gss_configure_script} "--libs" "gssapi"
OUTPUT_VARIABLE _gss_lib_flags
RESULT_VARIABLE _gss_configure_failed
OUTPUT_STRIP_TRAILING_WHITESPACE)
message(STATUS "FindGSS krb5-config --libs: ${_gss_lib_flags}")

if(NOT _gss_configure_failed) # 0 means success
# This script gives us libraries and link directories.
string(STRIP "${_gss_lib_flags}" _gss_lib_flags)
string(REGEX REPLACE " +-(L|l)" ";-\\1" _gss_lib_flags "${_gss_lib_flags}")
string(REGEX REPLACE " +-([^Ll][^ \\t;]*)" ";-\\1" _gss_lib_flags "${_gss_lib_flags}")

foreach(_flag IN LISTS _gss_lib_flags)
if(_flag MATCHES "^-l")
string(REGEX REPLACE "^-l" "" _flag "${_flag}")
list(APPEND _gss_LIBRARIES "${_flag}")
elseif(_flag MATCHES "^-L")
string(REGEX REPLACE "^-L" "" _flag "${_flag}")
list(APPEND _gss_LIBRARY_DIRS "${_flag}")
endif()
endforeach()
if(_gss_INCLUDE_DIRS AND _gss_LIBRARIES)

@vszakats vszakats Jun 17, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Indeed, though the "unknown" comment is already not satisfied for
any of the cases. Only MIT (and likely on Windows only) would return
"MIT Unknown", but even this diverges from all other Find modules,
which return an empty string in similar cases.

I propose to fix documentation and drop the outlier fallback value
in PR #22071.

vszakats added a commit that referenced this pull request Jun 17, 2026
After this patch the `GSS_VERSION` value is left empty in all cases when
there is known version number (potentially on Windows).

Also:
- sync `GSS_FOUND` comment with other Find modules.
- sync `GSS_VERSION` comment with other Find modules, drop the promise
  of returning "unknown", which was not true and also not done by other
  Find modules.
- tidy up Windows-registry-based MIT `GSS_VERSION` detection, by
  guarding the whole block for `WIN32`.
- drop fallback version value `MIT Unknown` used for MIT.
- fix vertical alignment in comment block.

Changing CMake log output like so (in affected config):
```
-- Found GSS: MIT (found version "MIT Unknown")
```
->
```
-- Found GSS: MIT
```

Spotted by Copilot
Bug: #22052 (comment)
Follow-up to 558814e

Closes #22071
vszakats added 26 commits June 27, 2026 19:33
This reverts commit 8cca323428d21fe5ba6f987301c818be9644a6eb.

Using GSSAPI everywhere would be nicer IMO, since it matches
macros and other symbols too, also easier to type, shorter and
it's the primary name on the wiki page:

https://en.wikipedia.org/wiki/Generic_Security_Services_Application_Programming_Interface

on the other hand RFC's consistently say GSS-API:
https://www.rfc-editor.org/info/rfc2743/

Either way, remain consistent with surrounding code for now.
It results in the exact same `--debug-find` output, as tested on
a system with case-insensitive FS. Keep uppercase to maybe help
case-sensitive ones, and a better convey this is a Framework. We
also use case-matched framework names elsewhere in the code.
(except for LDAP)
To stay within cmake line limit and to not trip pyspelling.
@vszakats vszakats closed this in d169ad6 Jul 3, 2026
@vszakats vszakats deleted the applegss branch July 3, 2026 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

appleOS specific to an Apple operating system authentication build CI Continuous Integration cmake feature-window A merge of this requires an open feature window

Development

Successfully merging this pull request may close these issues.

2 participants