This is either caused by trying to validate the document with the wrong
certificate/public key, or by the certificate being invalid.
> I got the IdP's certificate in an XML file and cut and pasted it into
> a idpcertificate.cer file, with the following format:
>
> -----BEGIN CERTIFICATE---
> MIIE9jC...... (cont.)
> -----END CERTIFICATE-----
There should be five minus-signs after BEGIN CERTIFICATE, as in:
-----BEGIN CERTIFICATE-----
In addition, the certificate should be broken into short lines. The
maximum length openssl will accept is 79 characters, the default length
is 64 characters.
If you have the openssl command line tool available, you can run the
following command to verify that openssl accepts the certificate:
openssl x509 -in idpcertificate.crt
On error, it will print something like:
unable to load certificate
22923:error:0906D064:PEM routines:PEM_read_bio:bad base64 decode:pem_lib.c:753:
If it is successful, it will print the certificate.
> If I double click on the idpcertificate.cer in Windows I can see the
> certificate nicely.
>
> In my metadata\saml20-idp-remote.php file I have the following:
> $metadata = array(
> /*
> * Login through SSO
> */
> 'https://someidpservername.eu' => array(
> 'name' => 'IdP',
> 'description' => 'Test against IdP',
> 'SingleSignOnService' => 'https://login.someidpservername.eu/idp/
> SSO.saml2',
> 'SingleLogoutService' => 'https://login.someidpservername.eu/idp/
> SLO.saml2',
> 'certFingerprint' => 'D567...(cont.)',
> 'certificate' => 'idpcertificate.crt',
> )
> );
>
> The certFingerprint I copied from the same XML file.
You only need either certFingerprint or certificate. If you set both,
the certificate will be used.