gnumoksha / php-freeipa

FreeIPA SDK for PHP
GNU Lesser General Public License v3.0
19 stars 19 forks source link

Error 77: error setting certificate verify location #23

Closed AbrarJahin closed 4 years ago

AbrarJahin commented 5 years ago

Hi, can you add an example in Readme File, please?

I am checking if there is any file named bootstrap.php, but I have failed to find any file.

I have run composer install, but still don't know how to use this library. An example in readme file to connect with the server would be appreciable.

I am trying this-

require_once('vendor/autoload.php');

$host = 'freeipa.bcc.gov.bd';
//$certificate = './vendor/gnumoksha/php-freeipa/certs/ipa.demo1.freeipa.org_ca.crt';
//$certificate = 'freeipa.bcc.gov.bd_ca.crt';
$certificate = 'ca.crt';
try {
    $ipa = new \FreeIPA\APIAccess\Main($host, $certificate);
    //print("Connected");
} catch (Exception $e) {
    print("\nError {$e->getCode()}: {$e->getMessage()}");
}

////////////////////////////////////////////////////////////////////////////////////////// $user = 'admin'; $password = '12345678'; try { $auth = $ipa->connection()->authenticate($user, $password); if ($auth) { print 'Logged in'; } else { $auth_info = $ipa->connection()->getAuthenticationInfo(); var_dump($auth_info); } } catch (Exception $e) { print("\nError {$e->getCode()}: {$e->getMessage()}"); }

And finding this error-

Error 77: error setting certificate verify locations: CAfile: ca.crt CApath: none Error 0: User is not logged in

CAn you plelase help?

gnumoksha commented 5 years ago

Hi, can you add an example in Readme File, please?

Here https://github.com/gnumoksha/php-freeipa/tree/v0#quick-start-guide

I am checking if there is any file named bootstrap.php, but I have failed to find any file.

You can use composer autoload.

And finding this error-

Error 77: error setting certificate verify locations: CAfile: ca.crt CApath: none Error 0: User is not logged in

You must use the certificate you got from your server.

gnumoksha commented 4 years ago

Hi. I'm going to close this. Feel free to open a new issue if you have any questions.