Open kwri-avongluck opened 4 years ago
Hi,
This looks like it's related to the SSL package by Spatie spatie/ssl-certificate
Will give it a look when we get some time, or if you could submit a PR to fix it then can merge.
Thanks
The issue appears to be due to "spatie/ssl-certificate" adding a "verify" flag to it's certificate downloader:
public function withVerifyPeer(bool $verifyPeer)
{
$this->verifyPeer = $verifyPeer;
return $this;
}
public function withVerifyPeerName(bool $verifyPeerName)
{
$this->verifyPeerName = $verifyPeerName;
return $this;
}
There's a bug about it here: https://github.com/spatie/ssl-certificate/issues/69
Here's the workaround:
diff --git a/app/Checkers/Certificate.php b/app/Checkers/Certificate.php
index bcbca87..058da18 100644
--- a/app/Checkers/Certificate.php
+++ b/app/Checkers/Certificate.php
@@ -31,7 +31,7 @@ class Certificate
private function fetch()
{
- $certificate = SslCertificate::createForHostName($this->website->certificate_hostname);
+ $certificate = SslCertificate::download()->withVerifyPeer(false)->withVerifyPeerName(false)->forHost($this->website->certificate_hostname);
$scan = new CertificateScan([
'issuer' => $certificate->getIssuer(),
Hey @kwri-avongluck
Thanks for supplying the fix.
Are you able to provide a demo domain with an expired SSL so we can test our end please?
Thanks