Plugin Directory

Changeset 1251311


Ignore:
Timestamp:
09/22/2015 03:43:29 PM (11 years ago)
Author:
FreshMail.com
Message:

Przy komunikacie o błędzie error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed od razu wyświetlamy komunikat, że można go rozwiazać wyłaczając wymaganie certyfikatu, ale użytkownik robi to na własne ryzyko.

Location:
freshmail-newsletter/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • freshmail-newsletter/trunk/CHANGELOG.md

    r1235259 r1251311  
    11### Changelog
     2
     3- 2.1.5 - 2015-09-22
     4    * Fix: Add possibility to disable SSL verification.
    25
    36- 2.1.4 - 2015-09-01
  • freshmail-newsletter/trunk/readme.txt

    r1205963 r1251311  
    55Requires at least: 3.0
    66Tested up to: 4.2.2
    7 Stable tag: 2.1.3
     7Stable tag: 2.1.5
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    174174== Changelog ==
    175175
     176- 2.1.5 - 2015-09-22
     177    * Fix: Add possibility to disable SSL verification.
     178
     179- 2.1.4 - 2015-09-01
     180    * Fix: Now ApiKey and ApiSecret are checking only once per day or if they were changed.
     181
    176182- 2.1.3 - 2015-07-24
    177183    * Add: Option to display popout on every single page, post, product.
  • freshmail-newsletter/trunk/src/Plugin/Newsletter/Freshmail.php

    r1235259 r1251311  
    77class Freshmail
    88{
    9     private $fmApiKey, $fmApiSecret, $api, $connect, $fmSettings, $reportType, $reportArray;
     9    private $fmApiKey, $fmApiSecret, $fmVerifySSL, $api, $connect, $fmSettings, $reportType, $reportArray;
    1010
    1111    public function __construct()
     
    3434        $this->fmApiKey = get_option('freshmail_api_key');
    3535        $this->fmApiSecret = get_option('freshmail_api_secret');
     36        $this->fmVerifySSL = (get_option('freshmail_dont_verify_ssl', 'false') == 'false');
    3637        $this->connect = $this->connect();
    3738
     
    147148            $this->api->setApiKey($this->fmApiKey);
    148149            $this->api->setApiSecret($this->fmApiSecret);
     150            $this->api->setVerifySSL($this->fmVerifySSL);
    149151
    150152            $date = new \DateTime('+1 day');
     
    230232                update_option('freshmail_uninstall_all', 'false');
    231233            }
     234
     235            if (isset($_POST['freshmail_dont_verify_ssl'])) {
     236                if ($_POST['freshmail_dont_verify_ssl'] == 'true') {
     237                    update_option('freshmail_dont_verify_ssl', 'true');
     238                }
     239            } else {
     240                update_option('freshmail_dont_verify_ssl', 'false');
     241            }
    232242        }
    233243
    234244        $uninstallAll = get_option('freshmail_uninstall_all', 'false');
     245        $doNotVerifySSL = get_option('freshmail_dont_verify_ssl', 'false');
    235246        require_once(WP_FRESHMAIL_DIR.'/templates/admin_connect_page.php');
    236247    }
  • freshmail-newsletter/trunk/templates/admin_connect_page.php

    r1187394 r1251311  
    5757        </p>
    5858        <p>
     59            <label><input type="checkbox" name="freshmail_dont_verify_ssl" value="true" <?php echo ($doNotVerifySSL == 'true') ? 'checked="checked"' : null; ?>><?php echo __('Do not verify the SSL certificates (at your own risk).', 'wp_freshmail'); ?></label>
     60        </p>
     61        <p>
    5962            <input type="submit" value="<?php echo __('Save settings', 'wp_freshmail'); ?>" class="button button_fm" name="freshmail_save_settings">
    6063        </p>
  • freshmail-newsletter/trunk/vendor/class.rest.php

    r1181908 r1251311  
    1515    private $httpCode = null;
    1616    private $contentType = 'application/json';
     17    private $boolVerifySSL = true;
    1718    const host = 'https://api.freshmail.com/';
    1819    const prefix = 'rest/';
     
    5758
    5859    /**
     60     *
     61     * @return bool
     62     */
     63    public function getVerifySSL()
     64    {
     65        return $this->boolVerifySSL;
     66    }
     67
     68    /**
    5969     * Metoda ustawia secret do API
    6070     *
     
    90100    }//setApiKey
    91101
     102    /**
     103     *
     104     * @param bool $boolVerifySSL
     105     * @return rest_api
     106     */
     107    public function setVerifySSL($boolVerifySSL)
     108    {
     109        $this->boolVerifySSL = $boolVerifySSL;
     110
     111        return $this;
     112    }
     113
     114
    92115    public function doRequest($strUrl, $arrParams = array(), $boolRawResponse = false)
    93116    {
     
    114137            curl_setopt($resCurl, CURLOPT_POSTFIELDS, $strPostData);
    115138        }//endif
     139        if(!$this->boolVerifySSL) {
     140            curl_setopt($resCurl, CURLOPT_SSL_VERIFYPEER, false);
     141        }
    116142        $this->rawResponse = curl_exec($resCurl);
    117143        $this->httpCode = curl_getinfo($resCurl, CURLINFO_HTTP_CODE);
     
    129155        }//endif
    130156        if (is_array($this->response) == false) {
    131             throw new Exception('Connection error - curl error message: '.curl_error($resCurl).' ('.curl_errno($resCurl).')');
     157            if(curl_errno($resCurl) == 60) {
     158                throw new Exception('There was an error with SSL certificate verification, to fix it please go to FreshMail settings and disable SSL verification. [Curl error message: '.curl_error($resCurl).' ('.curl_errno($resCurl).')]');
     159            } else {
     160                throw new Exception('Connection error - curl error message: '.curl_error($resCurl).' ('.curl_errno($resCurl).')');
     161            }
    132162        }//endif
    133163        return $this->response;
  • freshmail-newsletter/trunk/wp-freshmail.php

    r1235259 r1251311  
    44 * Plugin URI: http://freshmail.com/plugin/wordpress-newsletter/
    55 * Description: FreshMail is an email marketing tool for creating and sending amazing newsletters. Our intuitive system leads users from campaign planning and creation to final reports. A free account lets you send up to 2000 messages to a maximum of 500 recipients each month.
    6  * Version: 2.1.4
     6 * Version: 2.1.5
    77 * Author: Borbis Media
    88 * Author URI: http://www.borbis.com
Note: See TracChangeset for help on using the changeset viewer.