@@ -36,10 +36,11 @@ class IdPMetadataParser
3636 * @param string $desiredNameIdFormat If available on IdP metadata, use that nameIdFormat
3737 * @param string $desiredSSOBinding Parse specific binding SSO endpoint
3838 * @param string $desiredSLOBinding Parse specific binding SLO endpoint
39+ * @param bool $validatePeer Enable or disable validate peer SSL certificate
3940 *
4041 * @return array metadata info in php-saml settings format
4142 */
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 )
4344 {
4445 $ metadataInfo = array ();
4546
@@ -51,7 +52,7 @@ public static function parseRemoteXML($url, $entityId = null, $desiredNameIdForm
5152 curl_setopt ($ ch , CURLOPT_CUSTOMREQUEST , "GET " );
5253 curl_setopt ($ ch , CURLOPT_RETURNTRANSFER , 1 );
5354 curl_setopt ($ ch , CURLOPT_FOLLOWLOCATION , 1 );
54- curl_setopt ($ ch , CURLOPT_SSL_VERIFYPEER , 0 );
55+ curl_setopt ($ ch , CURLOPT_SSL_VERIFYPEER , $ validatePeer );
5556 curl_setopt ($ ch , CURLOPT_FAILONERROR , 1 );
5657
5758 $ xml = curl_exec ($ ch );
0 commit comments