• jsievers
  • NEWBIE
  • 0 Points
  • Member since 2015
  • Communications Manager
  • IHR

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 5
    Replies
Hello,

My code works fine until I activate the upcoming TLS update. Then, it reroutes me to a Salesforce page weakhttps.jsp?l=1 with a "Stronger security is required" message. As far as I can tell TLS1.2 is active and working, but is there a way to check that cURL is using it?

This is running on Windows 7, iis. The relevant section of my code:
curl_setopt($ch, CURLOPT_SSLVERSION, 6);
curl_setopt($ch, CURLOPT_URL, "https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8");
curl_setopt($ch, CURLOPT_POST, count($kv));
curl_setopt($ch, CURLOPT_CAINFO, dirname(__FILE__) . '/cacert.pem');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);

 
Hello,

My code works fine until I activate the upcoming TLS update. Then, it reroutes me to a Salesforce page weakhttps.jsp?l=1 with a "Stronger security is required" message. As far as I can tell TLS1.2 is active and working, but is there a way to check that cURL is using it?

This is running on Windows 7, iis. The relevant section of my code:
curl_setopt($ch, CURLOPT_SSLVERSION, 6);
curl_setopt($ch, CURLOPT_URL, "https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8");
curl_setopt($ch, CURLOPT_POST, count($kv));
curl_setopt($ch, CURLOPT_CAINFO, dirname(__FILE__) . '/cacert.pem');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);

 

Recently I got stuck with storing leads to SF via CURL calls, it was working perfectly before and somehow it stopped a few weeks ago.

I must emphasize that I didn't do any code changes which could possibly cause this function to fail.

Here is a part of my code:

//Initialize the $kv array for later use
$kv = array();

foreach ($prepare_data as $key => $value) {
    $kv[] = stripslashes($key)."=".stripslashes($value);
}

//Create a query string with join function separted by &
$query_string = join("&", $kv);

//Check to see if cURL is installed ...
if (function_exists('curl_init')) {

    $url = 'https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8';

    //Open cURL connection
    $ch = curl_init();

    //Set the url, number of POST vars, POST data
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_POST, count($kv));
    curl_setopt($ch, CURLOPT_POSTFIELDS, $query_string);

    //Set some settings that make it all work :)
    curl_setopt($ch, CURLOPT_HEADER, FALSE);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, FALSE);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);

    //Execute SalesForce web to lead PHP cURL
    $result = curl_exec($ch);

    //close cURL connection
    curl_close($ch);

}

$prepare_data variable has key/value pairing of SF fields. Keys are set from the HTML generated form.

I would appreciate help from someone who else have/had similar issues to try to solve this.

Thanks in advance