UPD:
Context:
The package manifest: /usr/local/pkg/ntopng.xml uses:
Config: /usr/local/pkg/ntopng.xml which includes:
Include: /usr/local/pkg/ntopng.inc which includes:
Include: /etc/inc/certs.inc which holds the cert-functions
The cert-functions are then used like this:
$cert = lookup_cert($config['system']['webgui']['ssl-certref']);
ntopng_write_cert_file("/usr/local/share/ntopng/httpdocs/ssl/ntopng-cert.pem", $cert);
Which is the problem I guess, as the ['ssl-certref'] is used alone, without any dependent intermediate certs.