2017-07-11 120 views
0

我有一個通過SOAP調用Web服務的PHP網站。它使用nusoap調用WS。HTTP錯誤:curl錯誤:27:SSL:無法在Heroku中創建上下文

它的工作非常好我的本地機器和另一臺服務器上,但在Heroku上,下面的異常被拋出:

HTTP Error: cURL ERROR: 27: SSL: couldn't create a context: error:140A90C4:SSL routines:SSL_CTX_new:null ssl method passed url: https://xxx/yyy.Services content_type:

的代碼是:

// Primeiro Try 
$obClient = new nusoap_client ($url_webservice, 'wsdl'); 
$obClient->setCurlOption(CURLOPT_SSLVERSION, 4); 

$erro = $obClient->getError(); 
if ($erro) { 
    throw new Exception ("Erro ao conectar", 9999); 
} 

$retorno = $obClient->call ($funcao_chamada, $parametros); 

if ($obClient->fault != '') { 
    $error = $obClient->error_str; 
    throw new Exception (utf8_encode ($error), 9997); 

} 

$erro = $obClient->getError(); 
if ($erro) { 
    $error = $obClient->error_str; 
    throw new Exception (utf8_encode ($error), 9998); 
} 

return $retorno; 
} 

什麼,它的發生?

回答

1

我使用的nusoap.php,我是調用該方法setCurlOption傳遞後續PARAMS:

setCurlOption(CURLOPT_SSLVERSION,4)

當我評論該行的問題得到了解決。