]> cat aescling's git repositories - mastodon.git/commitdiff
Rescue SSL error in verify link service (#9914)
authorRenato "Lond" Cerqueira <renato@lond.com.br>
Thu, 24 Jan 2019 14:38:18 +0000 (15:38 +0100)
committerEugen Rochko <eugen@zeonfederated.com>
Thu, 24 Jan 2019 14:38:18 +0000 (15:38 +0100)
If the first link to be verified contains a rel=me link with a SSL
error, the VerifyAccountLinksWorker will fail and not try the following
links. This rescues the SSL error when fetching the link, avoiding this
issue.

app/services/verify_link_service.rb

index c6557876137f778c0aefbebba8430b56d42e1421..878a2188dc30399090c42f98a52c34429e2b2ebf 100644 (file)
@@ -10,7 +10,7 @@ class VerifyLinkService < BaseService
     return unless link_back_present?
 
     field.mark_verified!
-  rescue HTTP::Error, Addressable::URI::InvalidURIError, Mastodon::HostValidationError, Mastodon::LengthValidationError => e
+  rescue OpenSSL::SSL::SSLError, HTTP::Error, Addressable::URI::InvalidURIError, Mastodon::HostValidationError, Mastodon::LengthValidationError => e
     Rails.logger.debug "Error fetching link #{@url}: #{e}"
     nil
   end