Repository: CS-SI/eodag

Issue:
missing ssl_verify in get_quicklook
`ssl_verify` parameter is not used in `EOProduct.get_quicklook` method and must be added.

Without this fix, the method is not working for provider `geodes`.

The setting must be get from the download plugin

Hints from issue comments:

Solution patch:
diff --git a/eodag/api/product/_product.py b/eodag/api/product/_product.py
index 4cc2030a5..c3934c91c 100644
--- a/eodag/api/product/_product.py
+++ b/eodag/api/product/_product.py
@@ -465,12 +465,20 @@ def format_quicklook_address() -> None:
             )
             if not isinstance(auth, AuthBase):
                 auth = None
+            # Read the ssl_verify parameter used on the provider config
+            # to ensure the same behavior for get_quicklook as other download functions
+            ssl_verify = (
+                getattr(self.downloader.config, "ssl_verify", True)
+                if self.downloader
+                else True
+            )
             with requests.get(
                 self.properties["quicklook"],
                 stream=True,
                 auth=auth,
                 headers=USER_AGENT,
                 timeout=DEFAULT_STREAM_REQUESTS_TIMEOUT,
+                verify=ssl_verify,
             ) as stream:
                 try:
                     stream.raise_for_status()


Test patch:
diff --git a/tests/units/test_eoproduct.py b/tests/units/test_eoproduct.py
index e05b2f37f..2e8f13f33 100644
--- a/tests/units/test_eoproduct.py
+++ b/tests/units/test_eoproduct.py
@@ -184,6 +184,7 @@ def test_eoproduct_get_quicklook_http_error(self):
             auth=None,
             headers=USER_AGENT,
             timeout=DEFAULT_STREAM_REQUESTS_TIMEOUT,
+            verify=True,
         )
         self.assertEqual(quicklook_file_path, "")
 
@@ -208,6 +209,7 @@ def test_eoproduct_get_quicklook_ok(self):
             auth=None,
             headers=USER_AGENT,
             timeout=DEFAULT_STREAM_REQUESTS_TIMEOUT,
+            verify=True,
         )
         self.assertEqual(
             os.path.basename(quicklook_file_path), product.properties["id"]
@@ -226,6 +228,7 @@ def test_eoproduct_get_quicklook_ok(self):
             auth=None,
             headers=USER_AGENT,
             timeout=DEFAULT_STREAM_REQUESTS_TIMEOUT,
+            verify=True,
         )
         self.assertEqual(self.requests_http_get.call_count, 2)
         self.assertEqual(os.path.basename(quicklook_file_path), "the_quicklook.png")