Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复windows上curl TLCP无法使用的问题 #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/scripts/spacecheck.pl
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"\\.(bat|sln|vc)\$",
"^tests/certs/.+\\.der\$",
"^tests/data/test",
"tongsuo.patch",
);

my @mixed_eol = (
Expand All @@ -49,6 +50,7 @@
my @space_at_eol = (
"^tests/.+\\.(cacert|crt|pem)\$",
"^tests/data/test",
"tongsuo.patch",
);

my @eol_at_eof = (
Expand Down
31 changes: 16 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

name: release

on:
'on':
workflow_dispatch:
tags:
- '*'
Expand Down Expand Up @@ -34,20 +34,20 @@ jobs:
needs: [new_release]
strategy:
matrix:
builder: [macos-latest, ubuntu-20.04]
builder: [ubuntu-20.04, macos-latest, macos-13]
name: "build-${{ matrix.builder }}"
steps:
- run: |
brew install libtool autoconf automake pkg-config
mv /usr/local/include/openssl /usr/local/include/openssl.bak
if: ${{ matrix.builder == 'macos-latest' }}
- run: brew install libtool autoconf automake pkg-config
if: ${{ matrix.builder == 'macos-latest' || matrix.builder == 'macos-13' }}
- run: mv /usr/local/include/openssl /usr/local/include/openssl.bak
if: ${{ matrix.builder == 'macos-13' }}
- name: build Tongsuo
run: |
VERSION=8.3.3
VERSION=8.4.0
wget "https://github.com/Tongsuo-Project/Tongsuo/archive/refs/tags/${VERSION}.tar.gz"
tar zxf "${VERSION}.tar.gz"
pushd "Tongsuo-${VERSION}"
./config --prefix=${GITHUB_WORKSPACE}/tongsuo no-shared enable-ntls --release
./config --prefix=${GITHUB_WORKSPACE}/tongsuo no-shared enable-ntls enable-ssl-trace --release
make -s -j4
make install_sw
popd
Expand All @@ -62,15 +62,14 @@ jobs:
autoreconf -fi
./configure --enable-warnings --enable-werror --with-openssl=${GITHUB_WORKSPACE}/tongsuo --without-zlib --without-brotli --disable-shared --disable-ldap --disable-ldaps --disable-rtsp --without-librtmp --enable-static
make -s -j4

- name: upload artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ needs.new_release.outputs.upload_url }}
asset_path: ./curl/src/curl
asset_name: curl-${{ runner.os }}
asset_name: curl-${{ runner.os }}-${{ runner.arch }}
asset_content_type: application/octet-stream

build_windows:
Expand All @@ -88,7 +87,7 @@ jobs:
- name: Export env
shell: bash
run: |
VERSION=8.3.3
VERSION=8.4.0
echo "TONGSUO_VERSION=${VERSION}" >> $GITHUB_ENV
echo "TONGSUO_HOME=${GITHUB_WORKSPACE}\tongsuo${VERSION}" >> $GITHUB_ENV
- name: Download Tongsuo source
Expand All @@ -103,7 +102,7 @@ jobs:
pushd "Tongsuo-%TONGSUO_VERSION%"
mkdir _build
pushd _build
perl ..\Configure no-makedepend no-shared VC-WIN64A --prefix=%TONGSUO_HOME%
perl ..\Configure no-makedepend no-shared enable-ntls enable-ssl-trace VC-WIN64A --prefix=%TONGSUO_HOME% --release
nmake /S
nmake install_sw
popd
Expand All @@ -116,16 +115,18 @@ jobs:
working-directory: ./curl
shell: powershell
run: |
git apply tongsuo.diff
git apply --reject tongsuo.patc
./buildconf.bat
cd winbuild
nmake /f Makefile.vc mode=static WITH_SSL=static SSL_PATH=${env:TONGSUO_HOME} RTLIBCFG=static
nmake /f Makefile.vc MACHINE=x64 mode=static WITH_SSL=static SSL_PATH=${env:TONGSUO_HOME} RTLIBCFG=static ENABLE_NTLS=yes
cd ..
builds\libcurl-vc-x64-release-static-ssl-static-ipv6-sspi\bin\curl.exe --help tls | findstr tlcp
- name: upload artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ needs.new_release.outputs.upload_url }}
asset_path: .\curl\builds\libcurl-vc-x64-release-static-ssl-static-ipv6-sspi\bin\curl.exe
asset_name: curl-${{ runner.os }}.exe
asset_name: curl-${{ runner.os }}-${{ runner.arch }}.exe
asset_content_type: application/octet-stream
33 changes: 0 additions & 33 deletions .github/workflows/reuse.yml

This file was deleted.

91 changes: 73 additions & 18 deletions .github/workflows/tongsuo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,91 @@

name: build-with-tongsuo

on: [workflow_dispatch, pull_request, push]
'on': [workflow_dispatch, pull_request, push]

jobs:
autotools:
runs-on: 'ubuntu-latest'
timeout-minutes: 60

build_linux_macos:
runs-on: ${{ matrix.builder }}
strategy:
matrix:
builder: [ubuntu-20.04, macos-latest, macos-13]
name: "build-${{ matrix.builder }}"
steps:
- name: checkout tongsuo
uses: actions/checkout@v2
with:
repository: Tongsuo-Project/Tongsuo
path: Tongsuo
- name: install Tongsuo
working-directory: ./Tongsuo
- run: brew install libtool autoconf automake pkg-config
if: ${{ matrix.builder == 'macos-latest' || matrix.builder == 'macos-13' }}
- run: mv /usr/local/include/openssl /usr/local/include/openssl.bak
if: ${{ matrix.builder == 'macos-13' }}
- name: build Tongsuo
run: |
./config --banner=Configured --prefix=${GITHUB_WORKSPACE}/install enable-ntls
VERSION=8.4.0
wget "https://github.com/Tongsuo-Project/Tongsuo/archive/refs/tags/${VERSION}.tar.gz"
tar zxf "${VERSION}.tar.gz"
pushd "Tongsuo-${VERSION}"
./config --prefix=${GITHUB_WORKSPACE}/tongsuo no-shared enable-ntls enable-ssl-trace --release
make -s -j4
make install
- uses: actions/checkout@v3
make install_sw
popd
- uses: actions/checkout@v2
with:
path: curl

fetch-depth: 0
- name: build curl
working-directory: ./curl
run: |
git apply tongsuo.patch
autoreconf -fi
LDFLAGS=-Wl,-rpath=${GITHUB_WORKSPACE}/install/lib64/ ./configure --enable-warnings --enable-werror --with-openssl=${GITHUB_WORKSPACE}/install
make V=1
./configure --enable-warnings --enable-werror --with-openssl=${GITHUB_WORKSPACE}/tongsuo --without-zlib --without-brotli --disable-shared --disable-ldap --disable-ldaps --disable-rtsp --without-librtmp --without-libpsl --enable-static
make -s -j4
make V=1 examples
make V=1 -C tests
make V=1 test-ci
./src/curl --help tls | grep tlcp

build_windows:
runs-on: windows-latest
steps:
- run: choco install -y winrar
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: win64
- uses: ilammy/setup-nasm@v1
with:
platform: win64
- uses: shogo82148/actions-setup-perl@v1
- name: Export env
shell: bash
run: |
VERSION=8.4.0
echo "TONGSUO_VERSION=${VERSION}" >> $GITHUB_ENV
echo "TONGSUO_HOME=${GITHUB_WORKSPACE}\tongsuo${VERSION}" >> $GITHUB_ENV
- name: Download Tongsuo source
run: |
wget "https://github.com/Tongsuo-Project/Tongsuo/archive/refs/tags/${env:TONGSUO_VERSION}.tar.gz" -OutFile "${env:TONGSUO_VERSION}.tar.gz"
shell: powershell
- run: '"C:\Program Files\WinRAR\WinRAR.exe" -INUL x %TONGSUO_VERSION%.tar.gz'
shell: cmd
- name: Build Tongsuo
shell: cmd
run: |
pushd "Tongsuo-%TONGSUO_VERSION%"
mkdir _build
pushd _build
perl ..\Configure no-makedepend no-shared enable-ntls enable-ssl-trace VC-WIN64A --prefix=%TONGSUO_HOME% --release
nmake /S
nmake install_sw
popd
popd
- uses: actions/checkout@v2
with:
path: curl
fetch-depth: 0
- name: build curl
working-directory: ./curl
shell: powershell
run: |
git apply --reject tongsuo.patch
./buildconf.bat
cd winbuild
nmake /f Makefile.vc MACHINE=x64 mode=static WITH_SSL=static SSL_PATH=${env:TONGSUO_HOME} RTLIBCFG=static ENABLE_NTLS=yes
cd ..
builds\libcurl-vc-x64-release-static-ssl-static-ipv6-sspi\bin\curl.exe --help tls | findstr tlcp
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ PLAN9_DIST = plan9/include/mkfile \

EXTRA_DIST = CHANGES.md COPYING Makefile.dist \
RELEASE-NOTES $(CMAKE_DIST) $(VC_DIST) $(WINBUILD_DIST) \
$(PLAN9_DIST) buildconf.bat Dockerfile
$(PLAN9_DIST) buildconf.bat Dockerfile tongsuo.patch

CLEANFILES = $(VC14_LIBVCXPROJ) $(VC14_SRCVCXPROJ) \
$(VC14_10_LIBVCXPROJ) $(VC14_10_SRCVCXPROJ) \
Expand Down
63 changes: 0 additions & 63 deletions docs/examples/https-tlcp-doublecerts.c

This file was deleted.

57 changes: 0 additions & 57 deletions docs/examples/https-tlcp.c

This file was deleted.

Loading
Loading