Issue Bug Rejected

#77490geturl stream context doesn't respect ssl_* settings

Jochen Weber 08/12/16, 12:18 updated 03/29/18, 18:48

Description

Hi all.

if [‘SYS’][‘curlUse’] is false, we are using stream context in GeneralUtility::getUrl().
But there the [‘HTTP’][‘ssl_*’] are not respected.

i think something like this is needed:

$sslOptions = array();
$sslOptions[‘verify_peer’] = $GLOBALS[‘TYPO3_CONF_VARS’][‘HTTP’][‘ssl_verify_peer’];
$sslOptions[‘verify_peer_name’] = $GLOBALS[‘TYPO3_CONF_VARS’][‘HTTP’][‘ssl_verify_host’];
if ($GLOBALS[‘TYPO3_CONF_VARS’][‘HTTP’][‘ssl_verify_peer’]) {
if ($GLOBALS[‘TYPO3_CONF_VARS’][‘HTTP’][‘ssl_cafile’]) {
$sslOptions[‘cafile’] = $GLOBALS[‘TYPO3_CONF_VARS’][‘HTTP’][‘ssl_cafile’];
}
if ($GLOBALS[‘TYPO3_CONF_VARS’][‘HTTP’][‘ssl_capath’]) {
$sslOptions[‘capath’] = $GLOBALS[‘TYPO3_CONF_VARS’][‘HTTP’][‘ssl_capath’];
}
}
stream_context_set_option( $ctx, $sslOptions);

greets, jochen

Reviews 1