Change the version of TLS in PHP upload

1

My submission is returning this error ...

  

Warning: file_get_contents ( link ...): failed to open stream: HTTP request failed! HTTP / 1.1 400 TLS 1.1 or higher required in /home/storage/9/8e/3d/teste1124/public_html/tpl/site.php on line 124

$context = stream_context_create(array(
    'http' => array(    
        'method'  => 'POST',
        'content' => $content,
    )
));

$result = file_get_contents('https://webto.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8', null, $context);
  

And it looks like the file_get_contents request is using TLS 1.0, which stopped being supported by salesforce ...

Note 01 ... A line 124 of the error in the code is the line $ result = file_get_contents, above.

  

So I MONTED so I can test ........................................ ........................................

$context = stream_context_create([array(
     'http' => array(                                                       
         'method'  => 'POST',
         'content' => $content,
     ),
     'ssl' => [
          'crypto_method' => STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT |
                             STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT,
     ],
)]);

$result = file_get_contents('https://webto.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8', false, $context);
  

ERROR === Warning: stream_context_create (): options should have the form ["wrappername"] ["optionname"] = $ value in / home / storage / 9 / 8e / 3d / test1124 / public_html / tpl / index .php on line 126

Obs 02 ... A line 126 ===)]); of code above.

  

How can I correctly correct and adjust this shipment?    I'm setting up wrong sending or what will it be?

    
asked by anonymous 23.11.2017 / 05:22

0 answers