Skip to content

Fix: build libcurl with --with-secure-transport on macOS [INS-3359]#23

Merged
notjaywu merged 2 commits intodevelopfrom
macos-native-curl
Dec 14, 2023
Merged

Fix: build libcurl with --with-secure-transport on macOS [INS-3359]#23
notjaywu merged 2 commits intodevelopfrom
macos-native-curl

Conversation

@notjaywu
Copy link
Copy Markdown

@notjaywu notjaywu commented Dec 11, 2023

  1. This PR is to fix the issue 2255.
  2. The reason why it happens on macOS is that we are using OpenSSL as the implementation of TLS for all OS, but it will fail to read the keychain on macOS.
  3. SecureTransport is the native implementation of TLS on macOS, so we should build libcurl with the --with-secure-transport option.
  4. Only more thing I need to verify is whether it happens on Windows or not.

@notjaywu notjaywu marked this pull request as ready for review December 11, 2023 06:17
@notjaywu notjaywu changed the title [WIP] use --with-secure-transport to build libcurl on macos Fix: build libcurl with --with-secure-transport on macOS [INS-3359] Dec 11, 2023
@notjaywu notjaywu self-assigned this Dec 11, 2023
@notjaywu notjaywu added the bug label Dec 11, 2023
# ssl
####
if [ ! -z "$OPENSSL_BUILD_FOLDER" ]; then
if [ "${RUNNER_OS}" == "macOS" ]; then
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I wonder why we do this only for MacOS, and not only for Linux and Windows?

Copy link
Copy Markdown
Author

@notjaywu notjaywu Dec 11, 2023

Choose a reason for hiding this comment

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

According to the information from curl doc, Secure Transport is the native implementation of TLS on macOS. It can read the keychain on macOS correctly, but OpenSSL can NOT.

image

Copy link
Copy Markdown
Author

@notjaywu notjaywu Dec 11, 2023

Choose a reason for hiding this comment

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

I will check if this issue also happens on Windows and Linux tomorrow.

- name: Publish binary
if: startsWith(github.ref, 'refs/tags/')
run: |
pip install setuptools
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The reason why it runs pip install setuptools is because it will fail to run node-libcurl/node_modules/node-gyp/gyp/gyp_main.py without this step.

You can get more details here build error

Copy link
Copy Markdown

@jackkav jackkav Dec 11, 2023

Choose a reason for hiding this comment

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

The error is ModuleNotFoundError: No module named 'distutils'
It would appear distutils was deprecated in python 3.10 https://peps.python.org/pep-0632/
So this error is consistent with the github action ambient version being 3.12 or above.
Its worth mentioning that this step only fails on macos

@jackkav
Copy link
Copy Markdown

jackkav commented Dec 11, 2023

Is this tested with and without custom CA certificate?

@notjaywu notjaywu marked this pull request as draft December 12, 2023 07:53
@notjaywu notjaywu merged commit 1620bac into develop Dec 14, 2023
@notjaywu notjaywu deleted the macos-native-curl branch December 14, 2023 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants