blob: 5cb3adda0c077021225afdd71308e5dd18be8413 [file] [log] [blame]
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +01001<?php
2
3namespace RobThree\Auth\Providers\Qr;
4
5abstract class BaseHTTPQRCodeProvider implements IQRCodeProvider
6{
7 protected $verifyssl;
8
9 protected function getContent($url)
10 {
11 $curlhandle = curl_init();
12
13 curl_setopt_array($curlhandle, array(
14 CURLOPT_URL => $url,
15 CURLOPT_RETURNTRANSFER => true,
16 CURLOPT_CONNECTTIMEOUT => 10,
17 CURLOPT_DNS_CACHE_TIMEOUT => 10,
18 CURLOPT_TIMEOUT => 10,
19 CURLOPT_SSL_VERIFYPEER => $this->verifyssl,
20 CURLOPT_USERAGENT => 'TwoFactorAuth'
21 ));
22 $data = curl_exec($curlhandle);
23
24 curl_close($curlhandle);
25 return $data;
26 }
27}