mirror of
https://github.com/Radarr/Radarr.git
synced 2024-08-17 07:49:45 +02:00
Fixed: Report certificate validation failures when configuring Plex Media Server connection
Closes #6797 (cherry picked from commit ec62884649f7af5f0a29346741754590e6de99ce)
This commit is contained in:
parent
91691205db
commit
c061d7cec8
@ -195,7 +195,12 @@ private string ProcessRequest(HttpRequestBuilder requestBuilder)
|
|||||||
}
|
}
|
||||||
catch (WebException ex)
|
catch (WebException ex)
|
||||||
{
|
{
|
||||||
throw new PlexException("Unable to connect to Plex Media Server", ex);
|
if (ex.Status == WebExceptionStatus.TrustFailure)
|
||||||
|
{
|
||||||
|
throw new PlexException("Unable to connect to Plex Media Server, certificate validation failed.", ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new PlexException($"Unable to connect to Plex Media Server, {ex.Message}", ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
return response.Content;
|
return response.Content;
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
using NzbDrone.Common.Cache;
|
using NzbDrone.Common.Cache;
|
||||||
using NzbDrone.Common.Extensions;
|
using NzbDrone.Common.Extensions;
|
||||||
using NzbDrone.Core.Movies;
|
using NzbDrone.Core.Movies;
|
||||||
|
using NzbDrone.Core.Validation;
|
||||||
|
|
||||||
namespace NzbDrone.Core.Notifications.Plex.Server
|
namespace NzbDrone.Core.Notifications.Plex.Server
|
||||||
{
|
{
|
||||||
@ -192,13 +193,21 @@ public ValidationFailure Test(PlexServerSettings settings)
|
|||||||
}
|
}
|
||||||
catch (PlexAuthenticationException ex)
|
catch (PlexAuthenticationException ex)
|
||||||
{
|
{
|
||||||
_logger.Error(ex, "Unable to connect to Plex Server");
|
_logger.Error(ex, "Unable to connect to Plex Media Server");
|
||||||
return new ValidationFailure("AuthToken", "Invalid authentication token");
|
return new ValidationFailure("AuthToken", "Invalid authentication token");
|
||||||
}
|
}
|
||||||
|
catch (PlexException ex)
|
||||||
|
{
|
||||||
|
return new NzbDroneValidationFailure("Host", ex.Message);
|
||||||
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
_logger.Error(ex, "Unable to connect to Plex Server");
|
_logger.Error(ex, "Unable to connect to Plex Media Server");
|
||||||
return new ValidationFailure("Host", "Unable to connect to Plex Server");
|
|
||||||
|
return new NzbDroneValidationFailure("Host", "Unable to connect to Plex Media Server")
|
||||||
|
{
|
||||||
|
DetailedDescription = ex.Message
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
Loading…
Reference in New Issue
Block a user