Error opening socket ssl://mysite.com:443

From Do you speak Drupalish? Featured Drupal wiki-like documentation
Jump to: navigation, search
  • https://api.drupal.org/comment/53383#comment-53383
  • When I try to read this URL: "https://www.exporttrader.com" using drupal_http_request('https://www.exporttrader.com') I got this error: "Error opening socket ssl://www.exporttrader.com:443"
    • This cropped up with PHP 5.6. Openssl was enabled, and the problem wasn't happening on 5.3. I tried the patch and forced it to use sslv3 and tls, but it did not do the job for me. I switched to the chr module, but as of now, SSL posts using drupal_http_request under PHP 5.6 is not working for me.

Solutions

MyChoice curl

  • OOOOH finally I found the solution.. it's by using SSL v3 curl_setopt($ch, CURLOPT_SSLVERSION, 3); via
  • switch to https://www.drupal.org/project/chr
    • I trust it, anyway As of Drupal 7.21 you can register an alternative HTTP request function. Using the administrative section admin/config/services/chr you can set chr_curl_http_request() as the default method.
  • Sometimes, even this requires $conf['drupal_http_request_fails'] = FALSE;

stream_socket_client() disabled

  • In my case (as it turns out), my hosting provider had disabled a whole basket of php functions (41 in total) for security reasons. One of the disabled functions was stream_socket_client(). via