This commit is contained in:
dignajar 2016-09-25 15:20:03 -03:00
parent 7336b17473
commit 88a36bf433
2 changed files with 18 additions and 45 deletions

View File

@ -1,29 +0,0 @@
-----BEGIN CERTIFICATE-----
MIIFADCCA+igAwIBAgISA2K7seLRltgnL9Ac/1FJBDZjMA0GCSqGSIb3DQEBCwUA
MEoxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1MZXQncyBFbmNyeXB0MSMwIQYDVQQD
ExpMZXQncyBFbmNyeXB0IEF1dGhvcml0eSBYMzAeFw0xNjA5MjIxMjExMDBaFw0x
NjEyMjExMjExMDBaMBkxFzAVBgNVBAMTDmFwaS5ibHVkaXQuY29tMIIBIjANBgkq
hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxMZ48N1J5LGoYJ1GkmEEKw2UJ793qBXh
GVoz7R0z7PiFZeCGENL8IbqSrj0WcUSobw1gfvULHeQ2FwXb2Fj0GoiG4ImA40B3
ueAmagFRn4B1q23uqYUBbm2XCIeKuDy4Xyf8eRDiiYWhLXuB/RVEHHyWEqs1T3K1
uodhHLNv/3g0ocw/xDpNNijtX845yAafjSS6zkkKbqVkvzNDuYIttU7LeUVWWby1
6tbKjqCtknzVTyE/r9tUY3uL/Fy/xqmP4QYbhpVhA7/PNPtlGnoJH4zMwq3Lz5KA
ph6yCtI4ZCmR9ZkVuYz4mKeULfHl6qweTKhHHSfgsxndwxVnHyedAwIDAQABo4IC
DzCCAgswDgYDVR0PAQH/BAQDAgWgMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEF
BQcDAjAMBgNVHRMBAf8EAjAAMB0GA1UdDgQWBBTbPTZoRs+sr8+jMIffJIekbcgU
NjAfBgNVHSMEGDAWgBSoSmpjBH3duubRObemRWXv86jsoTBwBggrBgEFBQcBAQRk
MGIwLwYIKwYBBQUHMAGGI2h0dHA6Ly9vY3NwLmludC14My5sZXRzZW5jcnlwdC5v
cmcvMC8GCCsGAQUFBzAChiNodHRwOi8vY2VydC5pbnQteDMubGV0c2VuY3J5cHQu
b3JnLzAZBgNVHREEEjAQgg5hcGkuYmx1ZGl0LmNvbTCB/gYDVR0gBIH2MIHzMAgG
BmeBDAECATCB5gYLKwYBBAGC3xMBAQEwgdYwJgYIKwYBBQUHAgEWGmh0dHA6Ly9j
cHMubGV0c2VuY3J5cHQub3JnMIGrBggrBgEFBQcCAjCBngyBm1RoaXMgQ2VydGlm
aWNhdGUgbWF5IG9ubHkgYmUgcmVsaWVkIHVwb24gYnkgUmVseWluZyBQYXJ0aWVz
IGFuZCBvbmx5IGluIGFjY29yZGFuY2Ugd2l0aCB0aGUgQ2VydGlmaWNhdGUgUG9s
aWN5IGZvdW5kIGF0IGh0dHBzOi8vbGV0c2VuY3J5cHQub3JnL3JlcG9zaXRvcnkv
MA0GCSqGSIb3DQEBCwUAA4IBAQADaZ1D8CyP4S9KCkEtLAHiK8hAZFewNlMWdRh1
4c11XTTrcw0qnDd31j6yV+VQL0do4kGPVDVyI0KCaw+A4Ocl49kgcbuzvSNQFr8b
GjHeV7ZuYc4vpKhMwzIkYQ4hR/DKz7cmDY/6Nd4kj68ABQcsVhVVxPBddctVSvv7
3AI0nV1H4sXdVeAySqqWe8GDQ+HUpovzAVpXV5TBpunvD5JoODHBK6c4WjHTxBG/
XJJt4cuvxmHdjTNzSbvJG47pZa7w2NzcqRTSluSTOeNYthGZFu4guTrnanZkqdAo
aS2xasESySFptZH5r7SOgoIlLpEPUV5ghKRWbRqcfYOon+s+
-----END CERTIFICATE-----

View File

@ -67,33 +67,35 @@ class pluginAPI extends Plugin {
// Get the authentication key // Get the authentication key
$authKey = $this->getDbField('authKey'); $authKey = $this->getDbField('authKey');
$path = $this->phpPath(); $url = 'https://api.bludit.com/ping?authKey='.$authKey.'&url='.DOMAIN;
// Check if curl is installed // Check if curl is installed
if( function_exists('curl_version') ) { if( function_exists('curl_version') ) {
$url = 'https://api.bludit.com/ping?authKey='.$authKey; $ch = curl_init();
$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); curl_setopt($ch, CURLOPT_SSLVERSION, 3);
curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CAINFO, $path.'api.bludit.com.crt');
$out = curl_exec($ch); $out = curl_exec($ch);
if (FALSE === $out) { if($out === false) {
var_dump(curl_error($ch)); Log::set('Plugin API : '.'Curl error: '.curl_error($ch));
var_dump(curl_errno($ch));
} }
curl_close($ch); curl_close($ch);
var_dump($out);
} }
else {
$options = array(
"ssl"=>array(
"verify_peer"=>false,
"verify_peer_name"=>false
)
);
$stream = stream_context_create($options);
$out = file_get_contents($url, false, $stream);
}
} }
} }