err = "Timeout reached";
ZYPP_THROW(MediaTimeoutException(url));
break;
+ case CURLE_SSL_CACERT:
+ ZYPP_THROW(MediaBadCAException(url,_curlError));
case CURLE_SSL_PEER_CERTIFICATE:
default:
err = curl_easy_strerror(ok);
return str << form(_("Timeout exceed when access '%s'."), _url.c_str()) << endl;
return str << _msg << endl;
}
+
+ std::ostream & MediaBadCAException::dumpOn( std::ostream & str ) const
+ {
+ if (_msg.empty())
+ return str << form(_(" SSL certificate problem, verify that the CA cert is OK for '%s'."), _url.c_str()) << endl;
+ return str << _msg << endl;
+ }
/////////////////////////////////////////////////////////////////
} // namespace media
} // namespace zypp
std::string _msg;
};
+ class MediaBadCAException : public MediaException
+ {
+ public:
+ MediaBadCAException(const Url & url_r, const std::string & msg = "Invalid CA")
+ : MediaException(msg)
+ , _url(url_r.asString()), _msg(msg)
+ {}
+ virtual ~MediaBadCAException() throw() {};
+ protected:
+ virtual std::ostream & dumpOn( std::ostream & str ) const;
+ std::string _url;
+ std::string _msg;
+ };
/////////////////////////////////////////////////////////////////
} // namespace media
} // namespace zypp