external/libcmis/UnpackedTarball_libcmis.mk   |    1 +
 external/libcmis/factory-no-retry-ssl.patch.1 |   17 +++++++++++++++++
 2 files changed, 18 insertions(+)

New commits:
commit af79ac4bf4a27e2d77e60b64049de21102a8ba85
Author:     Michael Stahl <[email protected]>
AuthorDate: Thu Jun 20 12:37:28 2024 +0200
Commit:     Michael Stahl <[email protected]>
CommitDate: Thu Jun 20 15:59:27 2024 +0200

    libcmis: don't retry if the connection failed at TLS level
    
    ... for example due to bad certificate; it is pointless as it will
    fail exactly the same way.
    
    Change-Id: I654261b2691987453e4ac9a3e2f3019dce20da48
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169268
    Reviewed-by: Michael Stahl <[email protected]>
    Tested-by: Jenkins

diff --git a/external/libcmis/UnpackedTarball_libcmis.mk 
b/external/libcmis/UnpackedTarball_libcmis.mk
index d13b8cd463b1..4a0a1a5e9e03 100644
--- a/external/libcmis/UnpackedTarball_libcmis.mk
+++ b/external/libcmis/UnpackedTarball_libcmis.mk
@@ -19,6 +19,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,libcmis,\
        external/libcmis/0001-cid-1545775-COPY_INSTEAD_OF_MOVE.patch \
        external/libcmis/0001-Fix-warning-C4589-when-building-with-MSVC.patch \
        external/libcmis/http-session-cleanup.patch.1 \
+       external/libcmis/factory-no-retry-ssl.patch.1 \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/external/libcmis/factory-no-retry-ssl.patch.1 
b/external/libcmis/factory-no-retry-ssl.patch.1
new file mode 100644
index 000000000000..e549ca5e08c8
--- /dev/null
+++ b/external/libcmis/factory-no-retry-ssl.patch.1
@@ -0,0 +1,17 @@
+--- libcmis/src/libcmis/session-factory.cxx.orig       2024-06-19 
18:43:56.244832053 +0200
++++ libcmis/src/libcmis/session-factory.cxx    2024-06-20 11:46:26.518263605 
+0200
+@@ -94,8 +94,13 @@
+                 {
+                     response = httpSession->httpGetRequest( bindingUrl );
+                 }
+-                catch ( const CurlException& )
++                catch (const CurlException& e)
+                 {
++                    if (strcmp(e.what(), "Invalid SSL certificate") == 0)
++                    {
++                        // no point in trying other protocols
++                        throw e.getCmisException();
++                    }
+                     // Could be SharePoint - needs NTLM authentication
+                     session = new SharePointSession( bindingUrl, username,
+                                                       password, verbose );

Reply via email to