Skip to content

Allow CACerts to be plumbed through Server config? #47

@soatok

Description

@soatok

I'm failing to get this snippet to work on a Windows machine:

    public function canonicalizeActorID(string $handle): string
    {
        // bail-out to make tests pass
        if (str_starts_with($handle, 'https://')) {
            return $handle;
        }
        return (new Server())
            ->actor($handle)
            ->webfinger()
            ->getProfileId();
    }

The error message has very little to do with a bug in your code, and is a deeper problem with cURL on Windows. However, it's easy to fix.

Exception: cURL error 60: SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://mastodon.social/.well-known/webfinger?resource=acct:fedie2ee@mastodon.social

[...]\vendor\landrok\activitypub\src\ActivityPhp\Server\Http\Request.php:150
[...]\vendor\landrok\activitypub\src\ActivityPhp\Server\Http\WebFingerFactory.php:74
[...]\vendor\landrok\activitypub\src\ActivityPhp\Server\Actor.php:55
[...]\vendor\landrok\activitypub\src\ActivityPhp\Server.php:152

What I would like to do is configure a CACert.pem path (which I plan to fetch live via Certainty) in the Server object. However, pulling in Certainty yourself would also ensure this works cross-platform.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions