Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ca-certs.json not found in data directory #18

Closed
udf2457 opened this issue Apr 9, 2018 · 7 comments
Closed

ca-certs.json not found in data directory #18

udf2457 opened this issue Apr 9, 2018 · 7 comments

Comments

@udf2457
Copy link

udf2457 commented Apr 9, 2018

My apologies if I'm being stupid here but.....

I was getting this error in my code. So I simplified as much as possible:

<?php
use ParagonIE\Certainty\RemoteFetch;
require '../../vendor/autoload.php';
mkdir("/tmp/aaa");
$fetcher = new RemoteFetch("/tmp/aaa");
var_dump($fetcher->getLatestBundle());

This still yields the same:

Fatal error: Uncaught ParagonIE\Certainty\Exception\FilesystemException: ca-certs.json not found in data directory. in /blah/vendor/paragonie/certainty/src/Fetch.php:116
Stack trace:
#0 /blah/vendor/paragonie/certainty/src/Fetch.php(63): ParagonIE\Certainty\Fetch->listBundles()
#1 /blah/vendor/paragonie/certainty/src/Certainty.php(32): ParagonIE\Certainty\Fetch->getLatestBundle()
#2 /blah/vendor/paragonie/certainty/src/Validator.php(104): ParagonIE\Certainty\Certainty::getGuzzleClient()
#3 /blah/vendor/paragonie/certainty/src/Fetch.php(78): ParagonIE\Certainty\Validator::checkChronicleHash(Object(ParagonIE\Certainty\Bundle))
#4 /blah/local/foobar/TESTTEST.php(10): ParagonIE\Certainty\Fetch->getLatestBundle()
#5 {main}
  thrown in /blah/vendor/paragonie/certainty/src/Fetch.php on line 116

But ....

$ ls -la /tmp/aaa/
total 1456
drwxrwxr-x.  2 foobar   foobar     4096 Apr  9 23:44 .
drwxrwxrwt. 17 root root   8192 Apr  9 23:44 ..
-rw-rw-r--.  1 foobar   foobar   263596 Apr  9 23:44 cacert-2016-11-02.pem
-rw-rw-r--.  1 foobar   foobar   261889 Apr  9 23:44 cacert-2017-01-18.pem
-rw-rw-r--.  1 foobar   foobar   256008 Apr  9 23:44 cacert-2017-06-07.pem
-rw-rw-r--.  1 foobar   foobar   236061 Apr  9 23:44 cacert-2017-09-20.pem
-rw-rw-r--.  1 foobar   foobar   223903 Apr  9 23:44 cacert-2018-01-17.pem
-rw-rw-r--.  1 foobar   foobar   215556 Apr  9 23:44 cacert-2018-03-07.pem
-rw-rw-r--.  1 foobar   foobar       25 Apr  9 23:44 ca-certs.cache
-rw-rw-r--.  1 foobar   foobar     2205 Apr  9 23:44 ca-certs.json

Bearing in mind /tmp/aaa didn't even exist before I executed the PHP !

@udf2457
Copy link
Author

udf2457 commented Apr 9, 2018

I should perhaps comment that the data dir under vendor is empty. So I suspect certainty might have something hardcoded somewhere if its still looking for stuff where it shouldn't be ?

@paragonie-scott
Copy link
Member

Fetch is trying to use the existing bundles, so that the connection to Github is validated.

@paragonie-scott
Copy link
Member

Pull dev-master. Is it fixed?

@udf2457
Copy link
Author

udf2457 commented Apr 9, 2018

So does that not leave us in a Catch 22 scenario in terms of moving the writable location ?

@paragonie-scott
Copy link
Member

paragonie-scott commented Apr 9, 2018

As of (presumably) v2.0.1? Nope.

@paragonie-scott
Copy link
Member

paragonie-scott commented Apr 9, 2018

I'm having difficulty reproducing the issue you're encountering, but if Fetch fails it will now properly just download the stuff and then do Ed25519/Chronicle verification as expected. Please let me know if the dev-master code fixes the problem you're experiencing so I can tag v2.0.1.

@udf2457
Copy link
Author

udf2457 commented Apr 9, 2018

Yeah, that fixes it. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants