**Description**   

This error:

```
file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:14095126:SSL routines:ssl3_read_n:unexpected eof while reading

```

returns when:

```
$file = file_get_contents($url['url'], false, stream_context_create($arrContextOptions));

```

**Steps to Reproduce**   

Video to download:

<https://www.youtube.com/watch?v=r5NzAksjfDI>

*Extract the video id:*

```
$video_id = $yt->extractVideoId(implode($url));

```

*Get the downloadable url*

```
$links = $yt->getDownloadLinks($video_id, $selector = 'video');

```

*Get the array key for the specified video quality etc.*

```
$arrayindex = array_search('mp4, video, 1080p, audio', array_column($links, 'format'));

```

*Set $url to array*

```
$url = $links[$arrayindex];

```

*Disable SSL*

```
$arrContextOptions=array( "ssl"=>array( "verify_peer"=>false, "verify_peer_name"=>false, ), );

```

*Get the file from the url*

```
$video = file_get_contents($url['url'], false, stream_context_create($arrContextOptions));

```

*Send the video back to front end*

```
return view('convert', [ 'url' => $url['url'], 'quality' => $url['format'], ]);

```

**Expected behavior:**   

The video gets downloaded   

**Actual behavior:**   

I get this error: 

```
file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:14095126:SSL routines:ssl3_read_n:unexpected eof while reading

```

The code stops.

**Version**   

The latest version of:   

<https://github.com/Athlon1600/youtube-downloader/blob/master/src/YouTubeDownloader.php>

**Additional Information**   

This code is in the laravel framework, the code here is in the UrlController. This is a local development server, this error also shows up when the firewall is disabled. All the functions used in my code are in the YouTubeDownloader.php file