Jellyfin: Make SSL verification optional, but on by default
authorJohn Carr <john.carr@unrouted.co.uk>
Tue, 18 Jun 2024 14:17:12 +0000 (15:17 +0100)
committerJohn Carr <john.carr@unrouted.co.uk>
Tue, 18 Jun 2024 14:17:12 +0000 (15:17 +0100)
music_assistant/server/providers/jellyfin/__init__.py

index 1407855cd2140755fa010990fe7ff1a2190fd12a..2b4d3e0a0df752410f69cd4f7bdba9b6e1e8ffbc 100644 (file)
@@ -88,6 +88,7 @@ from .const import (
 CONF_URL = "url"
 CONF_USERNAME = "username"
 CONF_PASSWORD = "password"
+CONF_VERIFY_SSL = "verify_ssl"
 FAKE_ARTIST_PREFIX = "_fake://"
 
 
@@ -138,6 +139,15 @@ async def get_config_entries(
             required=False,
             description="The password to authenticate to the remote server.",
         ),
+        ConfigEntry(
+            key=CONF_VERIFY_SSL,
+            type=ConfigEntryType.BOOLEAN,
+            label="Verify SSL",
+            required=False,
+            description="Whether or not to verify the certificate of SSL/TLS connections.",
+            category="advanced",
+            default_value=True,
+        ),
     )
 
 
@@ -149,7 +159,7 @@ class JellyfinProvider(MusicProvider):
         session_config = SessionConfiguration(
             session=self.mass.http_session,
             url=str(self.config.get_value(CONF_URL)),
-            verify_ssl=False,
+            verify_ssl=bool(self.config.get_value(CONF_VERIFY_SSL)),
             app_name=USER_APP_NAME,
             app_version=CLIENT_VERSION,
             device_name=socket.gethostname(),