@@ -36,10 +36,11 @@ class IdPMetadataParser
36
36
* @param string $desiredNameIdFormat If available on IdP metadata, use that nameIdFormat
37
37
* @param string $desiredSSOBinding Parse specific binding SSO endpoint
38
38
* @param string $desiredSLOBinding Parse specific binding SLO endpoint
39
+ * @param bool $validatePeer Enable or disable validate peer SSL certificate
39
40
*
40
41
* @return array metadata info in php-saml settings format
41
42
*/
42
- public static function parseRemoteXML ($ url , $ entityId = null , $ desiredNameIdFormat = null , $ desiredSSOBinding = Constants::BINDING_HTTP_REDIRECT , $ desiredSLOBinding = Constants::BINDING_HTTP_REDIRECT )
43
+ public static function parseRemoteXML ($ url , $ entityId = null , $ desiredNameIdFormat = null , $ desiredSSOBinding = Constants::BINDING_HTTP_REDIRECT , $ desiredSLOBinding = Constants::BINDING_HTTP_REDIRECT , $ validatePeer = false )
43
44
{
44
45
$ metadataInfo = array ();
45
46
@@ -51,7 +52,7 @@ public static function parseRemoteXML($url, $entityId = null, $desiredNameIdForm
51
52
curl_setopt ($ ch , CURLOPT_CUSTOMREQUEST , "GET " );
52
53
curl_setopt ($ ch , CURLOPT_RETURNTRANSFER , 1 );
53
54
curl_setopt ($ ch , CURLOPT_FOLLOWLOCATION , 1 );
54
- curl_setopt ($ ch , CURLOPT_SSL_VERIFYPEER , 0 );
55
+ curl_setopt ($ ch , CURLOPT_SSL_VERIFYPEER , $ validatePeer );
55
56
curl_setopt ($ ch , CURLOPT_FAILONERROR , 1 );
56
57
57
58
$ xml = curl_exec ($ ch );
0 commit comments