Give a better error message for external shares with self-signed ssl certificates
This commit is contained in:
parent
54491e8c68
commit
9509bc403a
|
@ -33,6 +33,11 @@ $externalManager = new \OCA\Files_Sharing\External\Manager(
|
|||
|
||||
$name = OCP\Files::buildNotExistingFileName('/', $name);
|
||||
|
||||
// check for ssl cert
|
||||
if (substr($remote, 0, 5) === 'https' and !OC_Util::getUrlContent($remote)) {
|
||||
\OCP\JSON::error(array('data' => array('message' => $l->t("Invalid or untrusted ssl certificate"))));
|
||||
exit;
|
||||
} else {
|
||||
$mount = $externalManager->addShare($remote, $token, $password, $name, $owner);
|
||||
/**
|
||||
* @var \OCA\Files_Sharing\External\Storage $storage
|
||||
|
@ -46,3 +51,4 @@ if($result){
|
|||
$externalManager->removeShare($mount->getMountPoint());
|
||||
\OCP\JSON::error(array('data' => array('message' => $l->t("Couldn't add remote share"))));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue