A
A
ArtificialLife2016-07-20 21:04:28
PHP
ArtificialLife, 2016-07-20 21:04:28

How should PHP/IIS be configured to work with the VK API over HTTPS?

I log in, I get the code necessary to get an access_token, but I can't get it because of the following error:

file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

Tried to create a context:
<?php
$arrContextOptions=array(
    "ssl"=>array(
        "verify_peer"=>false,
        "verify_peer_name"=>false,
    ),
);  

$response = file_get_contents("https://maps.co.weber.ut.us/arcgis/rest/services/SDE_composite_locator/GeocodeServer/findAddressCandidates?Street=&SingleLine=3042+N+1050+W&outFields=*&outSR=102100&searchExtent=&f=json", false, stream_context_create($arrContextOptions));

echo $response; ?>

It doesn't help, it throws a non authorized error.
Also, I tried to get a free certificate. I downloaded the file with the *.cer extension, registered the path in php.ini:
openssl.cafile="C:\Program Files (x86)\PHP\v5.6\extras\ssl\cert.cer"

But it did not help, PHP says that the certificate is not valid.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question