FabioPacifici's avatar

Laravel Documentation occasionally returning error 520 when visiting the website using north VPN

Hi guys,

I hope you're all doing great!

One of my students is experiencing an issue when attempting to visit the Laravel documentation website (laravel.com/docs) while using North VPN. The issue occurs sporadically, not every day, and it appeared again today. Notably, the error presented itself when visiting the website on a desktop PC but not on a laptop, despite both devices being on the same network and utilizing identical VPN settings.

On the desktop PC, we encountered a Cloudflare error page displaying a 520 error. Here is a screenshot for your reference: screenshot

Additionally, there was an error in the command line when running php artisan doc. Below is the command output for review:

php artisan doc

  Which page would you like to open?
❯ 
   GuzzleHttp\Exception\RequestException 

  cURL error 60: SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://laravel.com/docs/10.x/index.json

  at vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php:211
    207|
    208|         // Create a connection exception if it was a specific error code.
    209|         $error = isset($connectionErrors[$easy->errno])
    210|             ? new ConnectException($message, $easy->request, null, $ctx)
    211|             : new RequestException($message, $easy->request, $easy->response, null, $ctx);
    212|
    213|         return P\Create::rejectionFor($error);
    214|     }
    215|
  at vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php:158
      GuzzleHttp\Handler\CurlFactory::createRejection()

  2   vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php:110
      GuzzleHttp\Handler\CurlFactory::finishError()

I'd appreciate any insights or assistance in resolving this matter.

Thank you!

0 likes
1 reply
LaryAI's avatar
Level 58

The issue you're encountering seems to be related to a combination of VPN usage, SSL certificate validation, and possibly Cloudflare's security settings. Here are a few steps you can take to troubleshoot and potentially resolve the issue:

1. Check SSL Certificates

The error message indicates an SSL certificate problem. Ensure that your system has the latest CA certificates. On Windows, you can update the CA certificates by following these steps:

  1. Download the latest CA certificates from curl.haxx.se.
  2. Save the file to a known location, e.g., C:\path\to\cacert.pem.
  3. Configure PHP to use this certificate file by editing your php.ini file:
    [curl]
    curl.cainfo = "C:\path\to\cacert.pem"
    
    [openssl]
    openssl.cafile = "C:\path\to\cacert.pem"
    

2. Verify VPN Configuration

Since the issue occurs sporadically and only on certain devices, it might be related to the VPN configuration. Ensure that the VPN is not blocking or interfering with the SSL handshake. You can try:

  1. Switching to a different VPN server.
  2. Disabling the VPN temporarily to see if the issue persists.

3. Check Firewall and Security Software

Ensure that your firewall or any security software is not blocking the connection to laravel.com. You can try temporarily disabling the firewall or security software to see if it resolves the issue.

4. Update Guzzle and Dependencies

Ensure that you are using the latest version of Guzzle and its dependencies. You can update them using Composer:

composer update guzzlehttp/guzzle

5. Use a Different Network

If possible, try accessing the Laravel documentation from a different network to see if the issue is network-specific.

6. Contact Cloudflare Support

If the issue persists, you might want to contact Cloudflare support, as the 520 error is a Cloudflare-specific error indicating that the web server is returning an unknown error.

Example Code to Test SSL Connection

You can use the following PHP script to test the SSL connection to laravel.com:

<?php

use GuzzleHttp\Client;
use GuzzleHttp\Exception\RequestException;

require 'vendor/autoload.php';

$client = new Client();

try {
    $response = $client->request('GET', 'https://laravel.com/docs/10.x/index.json');
    echo $response->getBody();
} catch (RequestException $e) {
    echo $e->getMessage();
}

Run this script to see if it successfully connects to the Laravel documentation. If it fails, the error message might provide more insights into the issue.

By following these steps, you should be able to identify and resolve the issue with accessing the Laravel documentation while using a VPN.

Please or to participate in this conversation.