You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adding a certificate to an asio::ssl::context fails on Windows with OpenSSL 3.2 with the error:
no start line (PEM routines) [asio.ssl:151584876]
Although the buffer being assigned does contain a valid start line. Interestingly, this only happens with OpenSSL 3.2 and only on Windows.
Digging a bit in the related code it seems like it fails here where ERR_GET_LIB() no longer returns ERR_LIB_PEM causing the code to continue and unconditionally set the error to PEM_R_NO_START_LINE as returned by OpenSSL. From the OpenSSL documentation it is not entirely clear to me if checking the error code combined with the library that returned the error is guaranteed to work on all versions, but it seems like a reasonable assumption.
This looks very much like it could be a regression in OpenSSL, maybe related to this commit but I haven't looked into that in detail.
Before digging more into the OpenSSL code and potentially filing a bug report there I would appreciate getting some input here first.
Turns out this was caused by somehow compiling with OpenSSL 3.2 headers while linking with an older version.
In my specific case this caused some of my GitHub actions tests to fail with the above error which wasn't immediately obvious as the Windows runners previously didn't shop with the OpenSSL headers/.lib files, but recently started including that causing issue if OpenSSL is also installed with eg. choco install openssl.
I though I was able to reproduce this but it turned out I had actually build the code above with OpenSSL 3.1 and then later upgraded to OpenSSL 3.2 so these libraries were used runtime.
A bit embarrassing that it took my so long to realize this but at least I hope this can help others who might experience something similar.
Adding a certificate to an
asio::ssl::context
fails on Windows with OpenSSL 3.2 with the error:Although the buffer being assigned does contain a valid start line. Interestingly, this only happens with OpenSSL 3.2 and only on Windows.
Digging a bit in the related code it seems like it fails here where
ERR_GET_LIB()
no longer returnsERR_LIB_PEM
causing the code to continue and unconditionally set the error toPEM_R_NO_START_LINE
as returned by OpenSSL. From the OpenSSL documentation it is not entirely clear to me if checking the error code combined with the library that returned the error is guaranteed to work on all versions, but it seems like a reasonable assumption.This looks very much like it could be a regression in OpenSSL, maybe related to this commit but I haven't looked into that in detail.
Before digging more into the OpenSSL code and potentially filing a bug report there I would appreciate getting some input here first.
Here is a small example that shows the issue:
Thanks a lot.
The text was updated successfully, but these errors were encountered: