From 0838a24b51caa87f2a942066e1ea8c1385ce4394 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Thu, 2 Apr 2015 09:42:11 +0000 Subject: [PATCH] =?UTF-8?q?new=20command=20=C2=ABcertificate=C2=BB=20to=20?= =?UTF-8?q?install=20CA=20certificate=20for=20SSL=20-=20file=20needs=20to?= =?UTF-8?q?=20be=20open=20...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/commands.hxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/commands.hxx b/src/commands.hxx index 1f3185c..fa6ec2f 100644 --- a/src/commands.hxx +++ b/src/commands.hxx @@ -1421,7 +1421,8 @@ class Certificate: public Command { Logger log(this, script); QString filename(script->replacevars(_filename)); QFile cacertfile(filename); - if (!cacertfile.exists()) throw FileNotFound(filename); + if (!cacertfile.exists() || !cacertfile.open(QIODevice::ReadOnly)) + throw FileNotFound(filename); QSslCertificate cacert(&cacertfile); if (cacert.isNull()) throw NotACertificate(filename); QSslSocket::addDefaultCaCertificate(cacert);