sreejithpm
6 years agoAdept
Unable to generate Session Key by using vanity URL
$user1 = "";
$pwd1 = "";
$user2 = "";
$pwd2 = "";
$our_community_url = "";
$basicAuthDet = "$user1:$pwd1";
$formData = "user.login=$user2&user.password=$pwd2";
$apiURL = '$our_community_url/restapi/vc/authentication/sessions/login';
$headers = array(
"Content-type: application/x-www-form-urlencoded"
);
if(trim($basicAuthDet) != ''){
$headers[] = "Authorization: Basic ".base64_encode($basicAuthDet);
}
echo '
';
print_r($headers);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$apiURL);
curl_setopt($ch, CURLOPT_FRESH_CONNECT,1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_FORBID_REUSE,1);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_POSTFIELDS,$formData);
$httpCode = curl_getinfo($ch);
$response = curl_exec($ch);
if(curl_errno($ch)){
echo 'Curl error: ' . curl_error($ch);
}
curl_close($ch);
print '
STAGE: CURL RESPONSE: '; print_r($response);
Hi All,
we have integrated Lithium in our application with proxy method to consume the APIs.
As part of deprecating API proxy method in your 19.10 release, we are doing the necessary changes from our end and noticed the below error while making the call to generate the Session Key to authenticate the APIs. I have provided the code snippet above for your reference.
Curl error: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
We have started getting the above error after changing the proxy URL with our community url.
so can you anyone please help me to resolve the error?
PHP & openssl version used in prod and stage environments are given below:
Stage: PHP Version 5.6.16 & OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008
Production: PHP Version 5.6.16 & OpenSSL 1.0.1e-fips 11 Feb 2013