diff --git a/Blacklight/utility/Utility.php b/Blacklight/utility/Utility.php index 23a522bd7..4eac92cef 100755 --- a/Blacklight/utility/Utility.php +++ b/Blacklight/utility/Utility.php @@ -400,7 +400,7 @@ class Utility */ public static function streamSslContextOptions($forceIgnore = false): array { - if (empty(NN_SSL_CAFILE) && empty(NN_SSL_CAPATH)) { + if (config('nntmux_ssl.ssl_cafile') === '' && config('nntmux_ssl.ssl_capath') === '') { $options = [ 'verify_peer' => false, 'verify_peer_name' => false, @@ -408,15 +408,15 @@ class Utility ]; } else { $options = [ - 'verify_peer' => $forceIgnore ? false : (bool) NN_SSL_VERIFY_PEER, - 'verify_peer_name' => $forceIgnore ? false : (bool) NN_SSL_VERIFY_HOST, - 'allow_self_signed' => $forceIgnore ? true : (bool) NN_SSL_ALLOW_SELF_SIGNED, + 'verify_peer' => $forceIgnore ? false : config('nntmux_ssl.ssl_verify_peer'), + 'verify_peer_name' => $forceIgnore ? false : config('nntmux_ssl.ssl_verify_host'), + 'allow_self_signed' => $forceIgnore ? true : config('nntmux_ssl.ssl_allow_self_signed'), ]; - if (! empty(NN_SSL_CAFILE)) { - $options['cafile'] = NN_SSL_CAFILE; + if (config('nntmux_ssl.ssl_cafile') !== '') { + $options['cafile'] = config('nntmux_ssl.ssl_cafile'); } - if (! empty(NN_SSL_CAPATH)) { - $options['capath'] = NN_SSL_CAPATH; + if (config('nntmux_ssl.ssl_capath') !== '') { + $options['capath'] = config('nntmux_ssl.ssl_capath'); } } // If we set the transport to tls and the server falls back to ssl, @@ -438,16 +438,16 @@ class Utility public static function curlSslContextOptions($verify = true): array { $options = []; - if ($verify && NN_SSL_VERIFY_HOST && (! empty(NN_SSL_CAFILE) || ! empty(NN_SSL_CAPATH))) { + if ($verify && config('nntmux_ssl.ssl_verify_host') && (! empty(config('nntmux_ssl.ssl_cafile')) || ! empty(config('nntmux_ssl.ssl_capath')))) { $options += [ - CURLOPT_SSL_VERIFYPEER => (bool) NN_SSL_VERIFY_PEER, - CURLOPT_SSL_VERIFYHOST => NN_SSL_VERIFY_HOST ? 2 : 0, + CURLOPT_SSL_VERIFYPEER => (bool) config('nntmux_ssl.ssl_verify_peer'), + CURLOPT_SSL_VERIFYHOST => config('nntmux_ssl.ssl_verify_host') ? 2 : 0, ]; - if (! empty(NN_SSL_CAFILE)) { - $options += [CURLOPT_CAINFO => NN_SSL_CAFILE]; + if (! empty(config('nntmux_ssl.ssl_cafile'))) { + $options += [CURLOPT_CAINFO => config('nntmux_ssl.ssl_cafile')]; } - if (! empty(NN_SSL_CAPATH)) { - $options += [CURLOPT_CAPATH => NN_SSL_CAPATH]; + if (! empty(config('nntmux_ssl.ssl_capath'))) { + $options += [CURLOPT_CAPATH => config('nntmux_ssl.ssl_capath')]; } } else { $options += [ diff --git a/Changelog b/Changelog index ba59db0fa..081afea27 100755 --- a/Changelog +++ b/Changelog @@ -1,4 +1,5 @@ 2018-03-04 DariusIII + * Fix: Fix ssl options check * Fix: Fix new user registration once again 2018-03-03 DariusIII * Chg: Upgrade nntmux configuration method diff --git a/config/nntmux.php b/config/nntmux.php index 943d0a7fe..6664b6423 100644 --- a/config/nntmux.php +++ b/config/nntmux.php @@ -1,16 +1,16 @@ 50, - 'items_per_cover_page' => 20, - 'max_pager_results' => 125000, - 'flood_check' => false, - 'flood_wait_time' => 5, - 'flood_max_requests_per_second' => 5, - 'echocli' => true, - 'rename_par2' => true, - 'rename_music_mediainfo' => true, - 'cache_expiry_short' => 300, - 'cache_expiry_medium' => 600, - 'cache_expiry_long' => 900, + 'items_per_page' => 50, + 'items_per_cover_page' => 20, + 'max_pager_results' => 125000, + 'flood_check' => false, + 'flood_wait_time' => 5, + 'flood_max_requests_per_second' => 5, + 'echocli' => true, + 'rename_par2' => true, + 'rename_music_mediainfo' => true, + 'cache_expiry_short' => 300, + 'cache_expiry_medium' => 600, + 'cache_expiry_long' => 900, ]; diff --git a/config/nntmux_ssl.php b/config/nntmux_ssl.php new file mode 100644 index 000000000..6c8aef08e --- /dev/null +++ b/config/nntmux_ssl.php @@ -0,0 +1,8 @@ + '', + 'ssl_capath' => '', + 'ssl_verify_peer' => false, + 'ssl_verify_host' => false, + 'ssl_allow_self_signed' => true, +]; \ No newline at end of file