frankenphp icon indicating copy to clipboard operation
frankenphp copied to clipboard

Error setting certificate file on latest static binary

Open aszenz opened this issue 7 months ago • 4 comments

What happened?

Cannot make http request via symfony http client

(Symfony\Component\HttpClient\Exception\TransportException(code: 0): Error setting certificate file: /etc/pki/tls/certs/ca-bundle.crt

As per https://frankenphp.dev/docs/known-issues/#troubleshooting-tlsssl-issues-with-static-binaries, i tried setting these env vars on starting franken php server but the error persists

My env is github actions ubuntu-latest

I download the static binary as:

- name: Install frankenphp binary
  run: curl https://frankenphp.dev/install.sh | sh
- name: Start frankenphp server
  run: ./frankenphp start --config Caddyfile > e2e/logs/frankenphp.log 2>&1
  env:
   - SSL_CERT_FILE: /etc/ssl/certs/ca-certificates.crt
   - SSL_CERT_DIR: /etc/ssl/certs

Caddy file

{
  debug
  log {
    output file e2e/logs/caddy.log
    format console
    level DEBUG
  }
  frankenphp
}

:8080 {
  root * public/
  encode gzip
  php_server
}

Build Type

Official static build

Worker Mode

No

Operating System

GNU/Linux

CPU Architecture

x86_64

PHP configuration

Using latest static build

Relevant log output


aszenz avatar May 26 '25 16:05 aszenz

Could you share a minimal reproducer (php code)? I can't seem to run into the issue.

henderkes avatar May 28 '25 13:05 henderkes

Could you share a minimal reproducer (php code)? I can't seem to run into the issue.

Did u try running on vanilla github actions with ubuntu, i suspect it maybe a platform issue

aszenz avatar May 28 '25 13:05 aszenz

this is the code, calling a wordpress json api using symfony's http client:

$response = $this
    ->client
    ->request(
        'GET',
        "https://{$domain}/wp-json/wp/v2/categories?slug={$category}",
        ['timeout' => 3],
    );

if (200 !== $response->getStatusCode()) {
    return self::CATEGORY_NONE;
}

$categories = $response->toArray();

aszenz avatar May 28 '25 13:05 aszenz

Okay, I was able to reproduce this now. It looks like we need to explicitly build curl with ca paths disabled and the fallback explicitly enabled.

I need to test whether this breaks anything before we can release it.

henderkes avatar Jun 04 '25 06:06 henderkes

can be closed, fixed upstream

henderkes avatar Jun 30 '25 15:06 henderkes