Web Hosting
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WordPress fix Reply To: Error: WordPress could not establish a secure connection to...

Discussion in 'Misc WordPress Requests' started by Abyss.Cong, Nov 19, 2017.

  1. Abyss.Cong

    Guest

    Reply To: Error: WordPress could not establish a secure connection to WordPress.org, by Abyss.Cong

    /**
    * Constructor
    */
    public function __construct() {
    $curl = curl_version();
    $this->version = $curl['version_number'];
    $this->handle = curl_init();

    //SaFly.ORG Adaption
    curl_setopt($this->handle, CURLOPT_RESOLVE, array("api.wordpress.org:80:66.155.40.187", "api.wordpress.org:443:66.155.40.187", "downloads.wordpress.org:80:66.155.40.203", "downloads.wordpress.org:443:66.155.40.203"));

    curl_setopt($this->handle, CURLOPT_HEADER, false);
    curl_setopt($this->handle, CURLOPT_RETURNTRANSFER, 1);
    if ($this->version >= self::CURL_7_10_5) {
    curl_setopt($this->handle, CURLOPT_ENCODING, '');
    }
    if (defined('CURLOPT_PROTOCOLS')) {
    curl_setopt($this->handle, CURLOPT_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS);
    }
    if (defined('CURLOPT_REDIR_PROTOCOLS')) {
    curl_setopt($this->handle, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS);
    }
    }

    Reply To: Error: WordPress could not establish a secure connection to WordPress.org
     
    #1

Share This Page

Web Hosting