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

feature ssls-export for SSL session im-/export #15924

Closed
wants to merge 9 commits into from

Conversation

icing
Copy link
Contributor

@icing icing commented Jan 7, 2025

Adds the experimentation feature ssls-export to libcurl and curl for importing and exporting SSL sessions from/to a file.

  • add functions to libcurl API
  • add command line option --ssl-sessions <filename> to curl
  • add documenation
  • add support in configure
  • add support in cmake
  • add pytest case

@icing
Copy link
Contributor Author

icing commented Jan 7, 2025

@vszakats Help! What does VS2013 want that other versions are happy with? I have no clue...

Also, the VS msh3 build seems to be generally broken. Nothing related to this PR.

CMakeLists.txt Outdated Show resolved Hide resolved
@vszakats
Copy link
Member

vszakats commented Jan 7, 2025

@vszakats Help! What does VS2013 want that other versions are happy with? I have no clue...

VisualStudioSolution is a 4th separate build system. It's using
project/generate.bat to initialize the input files.

This may fix it (I cannot test this build locally):

diff --git a/projects/generate.bat b/projects/generate.bat
index 8145883f3..d217848ac 100644
--- a/projects/generate.bat
+++ b/projects/generate.bat
@@ -164,6 +164,7 @@ rem
       call :element %1 lib "timediff.c" %3
       call :element %1 lib "nonblock.c" %3
       call :element %1 lib "warnless.c" %3
+      call :element %1 lib "curl_get_line.c" %3
       call :element %1 lib "curl_multibyte.c" %3
       call :element %1 lib "version_win32.c" %3
       call :element %1 lib "dynbuf.c" %3
@@ -176,6 +177,7 @@ rem
       call :element %1 lib "nonblock.h" %3
       call :element %1 lib "warnless.h" %3
       call :element %1 lib "curl_ctype.h" %3
+      call :element %1 lib "curl_get_line.h" %3
       call :element %1 lib "curl_multibyte.h" %3
       call :element %1 lib "version_win32.h" %3
       call :element %1 lib "dynbuf.h" %3

Also, the VS msh3 build seems to be generally broken. Nothing related to this PR.

msh3 has been bumped in vcpkg last week from 0.6.0 to 0.7.0, and
this version just hit the runner image now.

Unless there is someone willing to dig into what the issues are, our
best option is to temporarly drop this job.

microsoft/vcpkg@78030b6

@icing
Copy link
Contributor Author

icing commented Jan 7, 2025

Thanks, @vszakats ! The hidden depths here...!

Re msh3: yeah, I suspect as such. Agree that we should drop that build for now. It's not worth it in the current state of the msh3 adapter.

@bagder
Copy link
Member

bagder commented Jan 7, 2025

our best option is to temporarly drop this job.

Drop it. It is not even close to be useful at this stage.

vszakats added a commit to vszakats/curl that referenced this pull request Jan 7, 2025
Starting GHA runner image 20250105.1.0.

```
C:\vcpkg\installed\x64-windows\include\msh3.h(150,13): error C2143: syntax error: missing ':' before 'constant' [D:\a\curl\curl\bld\lib\libcurl_object.vcxproj]
C:\vcpkg\installed\x64-windows\include\msh3.h(150,13): error C2034: '<alignment member>': type of bit field too small for number of bits
C:\vcpkg\installed\x64-windows\include\msh3.h(150,22): error C2143: syntax error: missing ';' before ':'
C:\vcpkg\installed\x64-windows\include\msh3.h(150,22): error C2059: syntax error: ':'
C:\vcpkg\installed\x64-windows\include\msh3.h(151,1): error C2059: syntax error: '}'
C:\vcpkg\installed\x64-windows\include\msh3.h(244,24): error C2143: syntax error: missing ')' before '*'
C:\vcpkg\installed\x64-windows\include\msh3.h(244,24): error C2143: syntax error: missing '{' before '*'
C:\vcpkg\installed\x64-windows\include\msh3.h(245,5): error C2370: 'uint32_t': redefinition; different storage class
      C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.42.34433\include\stdint.h(24,28):
      see declaration of 'uint32_t'

C:\vcpkg\installed\x64-windows\include\msh3.h(245,14): error C2146: syntax error: missing ';' before identifier 'SettingsLength'
C:\vcpkg\installed\x64-windows\include\msh3.h(246,5): error C2059: syntax error: ')'
C:\vcpkg\installed\x64-windows\include\msh3.h(377,18): error C2143: syntax error: missing ':' before 'constant'
C:\vcpkg\installed\x64-windows\include\msh3.h(377,18): error C2034: '<alignment member>': type of bit field too small for number of bits
C:\vcpkg\installed\x64-windows\include\msh3.h(377,43): error C2143: syntax error: missing ';' before ':'
C:\vcpkg\installed\x64-windows\include\msh3.h(377,43): error C2059: syntax error: ':'
C:\vcpkg\installed\x64-windows\include\msh3.h(378,43): error C2143: syntax error: missing '{' before ':'
C:\vcpkg\installed\x64-windows\include\msh3.h(378,43): error C2059: syntax error: ':'
C:\vcpkg\installed\x64-windows\include\msh3.h(379,43): error C2143: syntax error: missing '{' before ':'
C:\vcpkg\installed\x64-windows\include\msh3.h(379,43): error C2059: syntax error: ':'
C:\vcpkg\installed\x64-windows\include\msh3.h(380,43): error C2143: syntax error: missing '{' before ':'
C:\vcpkg\installed\x64-windows\include\msh3.h(380,43): error C2059: syntax error: ':'
C:\vcpkg\installed\x64-windows\include\msh3.h(381,43): error C2143: syntax error: missing '{' before ':'
C:\vcpkg\installed\x64-windows\include\msh3.h(381,43): error C2059: syntax error: ':'
C:\vcpkg\installed\x64-windows\include\msh3.h(384,9): error C2059: syntax error: '}'
C:\vcpkg\installed\x64-windows\include\msh3.h(408,5): error C2059: syntax error: '}'
C:\vcpkg\installed\x64-windows\include\msh3.h(409,1): error C2059: syntax error: '}'
C:\vcpkg\installed\x64-windows\include\msh3.h(416,23): error C2143: syntax error: missing ')' before '*'
C:\vcpkg\installed\x64-windows\include\msh3.h(416,5): error C2081: 'MSH3_REQUEST_EVENT': name in formal parameter list illegal
C:\vcpkg\installed\x64-windows\include\msh3.h(416,23): error C2143: syntax error: missing '{' before '*'
C:\vcpkg\installed\x64-windows\include\msh3.h(417,5): error C2059: syntax error: ')'
C:\vcpkg\installed\x64-windows\include\msh3.h(419,31): error C2143: syntax error: missing '{' before '*'
C:\vcpkg\installed\x64-windows\include\msh3.h(425,41): error C2146: syntax error: missing ')' before identifier 'Handler'
C:\vcpkg\installed\x64-windows\include\msh3.h(425,41): error C2061: syntax error: identifier 'Handler'
C:\vcpkg\installed\x64-windows\include\msh3.h(425,41): error C2059: syntax error: ';'
C:\vcpkg\installed\x64-windows\include\msh3.h(425,48): error C2059: syntax error: ','
C:\vcpkg\installed\x64-windows\include\msh3.h(428,5): error C2059: syntax error: ')'
C:\vcpkg\installed\x64-windows\include\msh3.h(434,41): error C2146: syntax error: missing ')' before identifier 'Handler'
C:\vcpkg\installed\x64-windows\include\msh3.h(434,41): error C2061: syntax error: identifier 'Handler'
C:\vcpkg\installed\x64-windows\include\msh3.h(434,41): error C2059: syntax error: ';'
C:\vcpkg\installed\x64-windows\include\msh3.h(434,48): error C2059: syntax error: ','
C:\vcpkg\installed\x64-windows\include\msh3.h(436,5): error C2059: syntax error: ')'
C:\vcpkg\installed\x64-windows\include\msh3.h(494,18): error C2143: syntax error: missing ':' before 'constant'
C:\vcpkg\installed\x64-windows\include\msh3.h(494,18): error C2034: '<alignment member>': type of bit field too small for number of bits
C:\vcpkg\installed\x64-windows\include\msh3.h(494,38): error C2143: syntax error: missing ';' before ':'
C:\vcpkg\installed\x64-windows\include\msh3.h(494,38): error C2059: syntax error: ':'
C:\vcpkg\installed\x64-windows\include\msh3.h(495,38): error C2143: syntax error: missing '{' before ':'
C:\vcpkg\installed\x64-windows\include\msh3.h(495,38): error C2059: syntax error: ':'
C:\vcpkg\installed\x64-windows\include\msh3.h(496,38): error C2143: syntax error: missing '{' before ':'
C:\vcpkg\installed\x64-windows\include\msh3.h(496,38): error C2059: syntax error: ':'
C:\vcpkg\installed\x64-windows\include\msh3.h(497,38): error C2143: syntax error: missing '{' before ':'
C:\vcpkg\installed\x64-windows\include\msh3.h(497,38): error C2059: syntax error: ':'
C:\vcpkg\installed\x64-windows\include\msh3.h(498,38): error C2143: syntax error: missing '{' before ':'
C:\vcpkg\installed\x64-windows\include\msh3.h(498,38): error C2059: syntax error: ':'
C:\vcpkg\installed\x64-windows\include\msh3.h(499,38): error C2143: syntax error: missing '{' before ':'
C:\vcpkg\installed\x64-windows\include\msh3.h(499,38): error C2059: syntax error: ':'
C:\vcpkg\installed\x64-windows\include\msh3.h(500,38): error C2143: syntax error: missing '{' before ':'
C:\vcpkg\installed\x64-windows\include\msh3.h(500,38): error C2059: syntax error: ':'
C:\vcpkg\installed\x64-windows\include\msh3.h(501,9): error C2059: syntax error: '}'
C:\vcpkg\installed\x64-windows\include\msh3.h(507,5): error C2059: syntax error: '}'
C:\vcpkg\installed\x64-windows\include\msh3.h(508,1): error C2059: syntax error: '}'
C:\vcpkg\installed\x64-windows\include\msh3.h(515,24): error C2143: syntax error: missing ')' before '*'
C:\vcpkg\installed\x64-windows\include\msh3.h(515,5): error C2081: 'MSH3_LISTENER_EVENT': name in formal parameter list illegal
C:\vcpkg\installed\x64-windows\include\msh3.h(515,24): error C2143: syntax error: missing '{' before '*'
C:\vcpkg\installed\x64-windows\include\msh3.h(516,5): error C2059: syntax error: ')'
C:\vcpkg\installed\x64-windows\include\msh3.h(518,32): error C2143: syntax error: missing '{' before '*'
C:\vcpkg\installed\x64-windows\include\msh3.h(525,42): error C2146: syntax error: missing ')' before identifier 'Handler'
C:\vcpkg\installed\x64-windows\include\msh3.h(525,42): error C2061: syntax error: identifier 'Handler'
C:\vcpkg\installed\x64-windows\include\msh3.h(525,42): error C2059: syntax error: ';'
C:\vcpkg\installed\x64-windows\include\msh3.h(525,49): error C2059: syntax error: ','
C:\vcpkg\installed\x64-windows\include\msh3.h(527,5): error C2059: syntax error: ')'
D:\a\curl\curl\lib\vquic\curl_msh3.c(276,1): warning C4431: missing type specifier - int assumed. Note: C no longer supports default-int
D:\a\curl\curl\lib\vquic\curl_msh3.c(276,33): error C2061: syntax error: identifier 'msh3_conn_if'
D:\a\curl\curl\lib\vquic\curl_msh3.c(276,33): error C2059: syntax error: ';'
D:\a\curl\curl\lib\vquic\curl_msh3.c(276,46): error C2513: ' ': no variable declared before '='
D:\a\curl\curl\lib\vquic\curl_msh3.c(280,2): warning C4218: nonstandard extension used: must specify at least a storage class or a type
D:\a\curl\curl\lib\vquic\curl_msh3.c(318,1): warning C4431: missing type specifier - int assumed. Note: C no longer supports default-int
D:\a\curl\curl\lib\vquic\curl_msh3.c(318,30): error C2061: syntax error: identifier 'msh3_request_if'
D:\a\curl\curl\lib\vquic\curl_msh3.c(318,30): error C2059: syntax error: ';'
D:\a\curl\curl\lib\vquic\curl_msh3.c(318,46): error C2513: ' ': no variable declared before '='
D:\a\curl\curl\lib\vquic\curl_msh3.c(324,2): warning C4218: nonstandard extension used: must specify at least a storage class or a type
D:\a\curl\curl\lib\vquic\curl_msh3.c(680,19): warning C4013: 'MsH3RequestOpen' undefined; assuming extern returning int
D:\a\curl\curl\lib\vquic\curl_msh3.c(680,48): error C2065: 'msh3_request_if': undeclared identifier
D:\a\curl\curl\lib\vquic\curl_msh3.c(682,41): error C2065: 'MSH3_REQUEST_FLAG_FIN': undeclared identifier
D:\a\curl\curl\lib\vquic\curl_msh3.c(680,17): warning C4047: '=': 'MSH3_REQUEST *' differs in levels of indirection from 'int'
D:\a\curl\curl\lib\vquic\curl_msh3.c(700,9): error C2198: 'bool MsH3RequestSend(MSH3_REQUEST *,MSH3_REQUEST_SEND_FLAGS,const MSH3_HEADER *,size_t,const void *,uint32_t,void *)': too few arguments for call
D:\a\curl\curl\lib\vquic\curl_msh3.c(807,42): error C2065: 'MSH3_REQUEST_FLAG_FIN': undeclared identifier
D:\a\curl\curl\lib\vquic\curl_msh3.c(808,29): warning C4133: 'function': incompatible types - from 'char [1]' to 'const MSH3_HEADER *'
D:\a\curl\curl\lib\vquic\curl_msh3.c(807,13): error C2198: 'bool MsH3RequestSend(MSH3_REQUEST *,MSH3_REQUEST_SEND_FLAGS,const MSH3_HEADER *,size_t,const void *,uint32_t,void *)': too few arguments for call
D:\a\curl\curl\lib\vquic\curl_msh3.c(863,36): error C2065: 'msh3_conn_if': undeclared identifier
D:\a\curl\curl\lib\vquic\curl_msh3.c(863,35): warning C4047: 'function': 'const MSH3_CONNECTION_CALLBACK_HANDLER' differs in levels of indirection from 'int *'
D:\a\curl\curl\lib\vquic\curl_msh3.c(863,35): warning C4024: 'MsH3ConnectionOpen': different types for formal and actual parameter 2
D:\a\curl\curl\lib\vquic\curl_msh3.c(865,49): error C2197: 'MSH3_CONNECTION *MsH3ConnectionOpen(MSH3_API *,const MSH3_CONNECTION_CALLBACK_HANDLER,void *)': too many arguments for call
D:\a\curl\curl\lib\vquic\curl_msh3.c(866,35): error C2197: 'MSH3_CONNECTION *MsH3ConnectionOpen(MSH3_API *,const MSH3_CONNECTION_CALLBACK_HANDLER,void *)': too many arguments for call
D:\a\curl\curl\lib\vquic\curl_msh3.c(867,35): error C2197: 'MSH3_CONNECTION *MsH3ConnectionOpen(MSH3_API *,const MSH3_CONNECTION_CALLBACK_HANDLER,void *)': too many arguments for call
```
Ref: https://github.com/curl/curl/actions/runs/12653247149/job/35258053847#step:9:29

Bug: curl#15924 (comment)
@vszakats
Copy link
Member

vszakats commented Jan 7, 2025

Made #15927 to drop MSH3. Also made #15929 that renames a local macro variable named RESERVED which might collide with MSH3 (and other Windows headers), but got the old runner with that one, so it's hard to say for sure.

https://github.com/curl/curl/pull/15929.diff

@icing icing force-pushed the feature-ssls-export branch from e74db0e to 4c766f7 Compare January 7, 2025 16:21
vszakats added a commit that referenced this pull request Jan 7, 2025
Starting GHA runner image 20250105.1.0.

As seen on Linux with 0.7.0:
```
/home/runner/msh3/include/msh3.h:377:18: error: width of ‘RESERVED’ exceeds its type
  377 |             bool RESERVED                 : 5;
      |                  ^~~~~~~~
/home/runner/msh3/include/msh3.h:490:18: error: width of ‘RESERVED’ exceeds its type
  490 |             bool RESERVED            : 7;
      |                  ^~~~~~~~
```
https://github.com/curl/curl/actions/runs/12655717818/job/35266716846#step:35:195

Bug: #15924 (comment)
Bug: #15930 (comment)

Closes #15927
icing added 2 commits January 8, 2025 11:35
Adds the experimentation feature `ssls-export` to libcurl
and curl for importing and exporting SSL sessions from/to
a file.

* add functions to libcurl API
* add command line option `--ssl-sessions <filename>` to curl
* add documenation
* add support in configure
* add support in cmake
+ add pytest case
@icing icing force-pushed the feature-ssls-export branch from 4c766f7 to 3901a88 Compare January 8, 2025 10:35
Copy link
Member

@bagder bagder left a comment

Choose a reason for hiding this comment

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

Looks good!

docs/INSTALL-CMAKE.md Outdated Show resolved Hide resolved
@bagder bagder closed this in 515a21f Jan 8, 2025
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