diff --git a/www/saml2/idp/metadata.php b/www/saml2/idp/metadata.php
index fa83eb0f9cb645a1701c3bde2aed5566b981717a..550f34951e91c48c899a92e39de0d15910bd18bc 100644
--- a/www/saml2/idp/metadata.php
+++ b/www/saml2/idp/metadata.php
@@ -25,7 +25,7 @@ try {
 	$idpmeta = isset($_GET['idpentityid']) ? $_GET['idpentityid'] : $metadata->getMetaDataCurrent('saml20-idp-hosted');
 	$idpentityid = isset($_GET['idpentityid']) ? $_GET['idpentityid'] : $metadata->getMetaDataCurrentEntityID('saml20-idp-hosted');
 	
-	$publiccert = $config->getBaseDir() . '/cert/' . $idpmeta['certificate'];
+	$publiccert = $config->getPathValue('certdir') . $idpmeta['certificate'];
 
 	if (!file_exists($publiccert)) 
 		throw new Exception('Could not find certificate [' . $publiccert . '] to attach to the authentication resposne');