Skip to content

Commit

Permalink
修复windows上curl TLCP无法使用的问题
Browse files Browse the repository at this point in the history
windows上使用nmake构建,和Linux构建脚本不一样,增加NTLS相关编译选项;
同步curl最新代码后重新适配。
  • Loading branch information
dongbeiouba committed Jan 3, 2025
1 parent b032cbe commit 83e911d
Show file tree
Hide file tree
Showing 7 changed files with 787 additions and 878 deletions.
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
15 changes: 8 additions & 7 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 @@ -43,11 +43,11 @@ jobs:
if: ${{ matrix.builder == 'macos-latest' }}
- 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,7 +62,6 @@ 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:
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 @@ -119,7 +118,9 @@ jobs:
git apply tongsuo.diff
./buildconf.bat
cd winbuild
nmake /f Makefile.vc mode=static WITH_SSL=static SSL_PATH=${env:TONGSUO_HOME} RTLIBCFG=static
nmake /f Makefile.vc 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:
Expand Down
33 changes: 0 additions & 33 deletions .github/workflows/reuse.yml

This file was deleted.

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

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: [macos-latest, ubuntu-latest]
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' }}
- 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
./curl/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 tongsuo.diff
./buildconf.bat
cd winbuild
nmake /f Makefile.vc 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
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

0 comments on commit 83e911d

Please sign in to comment.