Skip to content
Permalink
Browse files
Only use cafile_path if specified in config
  • Loading branch information
machristie authored and eroma2014 committed Jan 26, 2021
1 parent 82c231f commit c3245971f23767c6b83f5a1919681ce5639253bd
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
@@ -30,7 +30,7 @@ public function getRealmRoleMappingsForUser($realm, $user_id){
curl_setopt($r, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($r, CURLOPT_ENCODING, 1);
curl_setopt($r, CURLOPT_SSL_VERIFYPEER, $this->verify_peer);
if($this->verify_peer){
if($this->verify_peer && $this->cafile_path){
curl_setopt($r, CURLOPT_CAINFO, $this->cafile_path);
}
curl_setopt($r, CURLOPT_HTTPHEADER, array(
@@ -61,7 +61,7 @@ public function addRealmRoleMappingsToUser($realm, $user_id, $role_representatio
curl_setopt($r, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($r, CURLOPT_ENCODING, 1);
curl_setopt($r, CURLOPT_SSL_VERIFYPEER, $this->verify_peer);
if($this->verify_peer){
if($this->verify_peer && $this->cafile_path){
curl_setopt($r, CURLOPT_CAINFO, $this->cafile_path);
}

@@ -97,7 +97,7 @@ public function deleteRealmRoleMappingsToUser($realm, $user_id, $role_representa
curl_setopt($r, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($r, CURLOPT_ENCODING, 1);
curl_setopt($r, CURLOPT_SSL_VERIFYPEER, $this->verify_peer);
if($this->verify_peer){
if($this->verify_peer && $this->cafile_path){
curl_setopt($r, CURLOPT_CAINFO, $this->cafile_path);
}

@@ -22,7 +22,7 @@ public function getRoles($realm){
curl_setopt($r, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($r, CURLOPT_ENCODING, 1);
curl_setopt($r, CURLOPT_SSL_VERIFYPEER, $this->verify_peer);
if($this->verify_peer){
if($this->verify_peer && $this->cafile_path){
curl_setopt($r, CURLOPT_CAINFO, $this->cafile_path);
}
curl_setopt($r, CURLOPT_HTTPHEADER, array(
@@ -29,7 +29,7 @@ public function getUsers($realm, $username = null){
curl_setopt($r, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($r, CURLOPT_ENCODING, 1);
curl_setopt($r, CURLOPT_SSL_VERIFYPEER, $this->verify_peer);
if($this->verify_peer){
if($this->verify_peer && $this->cafile_path){
curl_setopt($r, CURLOPT_CAINFO, $this->cafile_path);
}
curl_setopt($r, CURLOPT_HTTPHEADER, array(
@@ -75,7 +75,7 @@ public function searchUsers($realm, $keyword){
curl_setopt($r, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($r, CURLOPT_ENCODING, 1);
curl_setopt($r, CURLOPT_SSL_VERIFYPEER, $this->verify_peer);
if($this->verify_peer){
if($this->verify_peer && $this->cafile_path){
curl_setopt($r, CURLOPT_CAINFO, $this->cafile_path);
}
curl_setopt($r, CURLOPT_HTTPHEADER, array(
@@ -106,7 +106,7 @@ public function getUser($realm, $user_id) {
curl_setopt($r, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($r, CURLOPT_ENCODING, 1);
curl_setopt($r, CURLOPT_SSL_VERIFYPEER, $this->verify_peer);
if($this->verify_peer){
if($this->verify_peer && $this->cafile_path){
curl_setopt($r, CURLOPT_CAINFO, $this->cafile_path);
}
curl_setopt($r, CURLOPT_HTTPHEADER, array(
@@ -75,7 +75,7 @@ public function authenticate($username, $password){
// Decode compressed responses.
curl_setopt($r, CURLOPT_ENCODING, 1);
curl_setopt($r, CURLOPT_SSL_VERIFYPEER, $this->verify_peer);
if($this->verify_peer){
if($this->verify_peer && $this->cafile_path){
curl_setopt($r, CURLOPT_CAINFO, $this->cafile_path);
}

@@ -129,7 +129,7 @@ public function getOAuthToken($code){
// Decode compressed responses.
curl_setopt($r, CURLOPT_ENCODING, 1);
curl_setopt($r, CURLOPT_SSL_VERIFYPEER, $this->verify_peer);
if($this->verify_peer){
if($this->verify_peer && $this->cafile_path){
curl_setopt($r, CURLOPT_CAINFO, $this->cafile_path);
}

@@ -167,7 +167,7 @@ public function getUserProfileFromOAuthToken($token){
// Decode compressed responses.
curl_setopt($r, CURLOPT_ENCODING, 1);
curl_setopt($r, CURLOPT_SSL_VERIFYPEER, $this->verify_peer);
if($this->verify_peer){
if($this->verify_peer && $this->cafile_path){
curl_setopt($r, CURLOPT_CAINFO, $this->cafile_path);
}
curl_setopt($r, CURLOPT_HTTPHEADER, array(
@@ -213,7 +213,7 @@ public function getRefreshedOAuthToken($refresh_token){
// Decode compressed responses.
curl_setopt($r, CURLOPT_ENCODING, 1);
curl_setopt($r, CURLOPT_SSL_VERIFYPEER, $this->verify_peer);
if($this->verify_peer){
if($this->verify_peer && $this->cafile_path){
curl_setopt($r, CURLOPT_CAINFO, $this->cafile_path);
}

@@ -444,7 +444,7 @@ private function getOpenIDConnectDiscoveryConfiguration() {
// Decode compressed responses.
curl_setopt($r, CURLOPT_ENCODING, 1);
curl_setopt($r, CURLOPT_SSL_VERIFYPEER, $this->verify_peer);
if($this->verify_peer){
if($this->verify_peer && $this->cafile_path){
curl_setopt($r, CURLOPT_CAINFO, $this->cafile_path);
}

@@ -41,7 +41,7 @@ public function register()
$identityServerConfig['oauth-client-key'],
$identityServerConfig['oauth-client-secret'],
$identityServerConfig['oauth-callback-url'],
$identityServerConfig['cafile-path'],
isset($identityServerConfig['cafile-path'] ? $identityServerConfig['cafile-path'] : null,
$identityServerConfig['verify-peer'],
$identityServerConfig['service-url'],
$identityServerConfig['admin-username'],
@@ -16,7 +16,7 @@ public static function getAPIAccessToken($base_endpoint_url, $realm, $admin_user
curl_setopt($r, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($r, CURLOPT_ENCODING, 1);
curl_setopt($r, CURLOPT_SSL_VERIFYPEER, $verify_peer);
if($verify_peer){
if($verify_peer && $cafile_path){
curl_setopt($r, CURLOPT_CAINFO, $cafile_path);
}

0 comments on commit c324597

Please sign in to comment.