Skip to content
Snippets Groups Projects
Commit 382ea023 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

task-1462: disable ssl verification per config value

parent 9ff97ff3
No related branches found
No related tags found
No related merge requests found
...@@ -78,6 +78,7 @@ $aConfig = array( ...@@ -78,6 +78,7 @@ $aConfig = array(
'api'=>'<%= @replace["foreman-url"] %>', // with ending "/" 'api'=>'<%= @replace["foreman-url"] %>', // with ending "/"
'user'=>'<%= @replace["foreman-user"] %>', 'user'=>'<%= @replace["foreman-user"] %>',
'password'=>'<%= @replace["foreman-password"] %>', 'password'=>'<%= @replace["foreman-password"] %>',
'verify-ssl'=><%= @replace["foreman-verify-ssl"] %>,
// 'varname-replace'=>'ci-replacement', // 'varname-replace'=>'ci-replacement',
), ),
// where to store project data // where to store project data
......
...@@ -246,7 +246,12 @@ class ForemanApi { ...@@ -246,7 +246,12 @@ class ForemanApi {
} }
curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
if (array_key_exists('verify-ssl', $this->_aCfg) && !$this->_aCfg['verify-ssl']){
$this->log(__FUNCTION__ . " WARNING: SSL verifify was disabled in the config.", 'warning');
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
}
curl_setopt($ch, CURLOPT_TIMEOUT, $iTimeout); curl_setopt($ch, CURLOPT_TIMEOUT, $iTimeout);
curl_setopt($ch, CURLOPT_USERAGENT, 'IML Deployment GUI :: ' . __CLASS__); curl_setopt($ch, CURLOPT_USERAGENT, 'IML Deployment GUI :: ' . __CLASS__);
if ($sApiUser){ if ($sApiUser){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment