Demac Media Demac Media Brand Demac Media Brand

Blog

Subscribe

Important New Patch For Your Magento Canada Post Application

Timer Icon 3 Mins

eCommerce, Magento Commerce

Canada Post recently went through an infrastructure update on March 10, 2018. Due to this update, your Magento Canada Post Application developed by Demac Media must be updated. Please see the recommended steps below to patch the application.

Steps To Patch Your Magento Canada Post Application:

  1. Download the updated module from here: https://info.demacmedia.com/hubfs/demac-canadapost.zip
  2. Extract the ZIP contents

If you have access to a developer, we strongly recommend you use them to apply these changes. If not, don’t worry! There are two different approaches you can take here:

Method 1 (Easy):

Copy these files from the extracted folder and overwrite them on your website (where the app folder is):

demac-canadapost/app/code/community/Demac/CanadaPost/etc/cert/cacert.pem

demac-canadapost/app/code/community/Demac/CanadaPost/Model/Adapter/Abstract.php

Method 2 (Hard – For a developer):

Step 1) Update the certificate from the extracted ZIP file: demac-canadapost/app/code/community/Demac/CanadaPost/etc/cert/cacert.pem

Step 2) Apply the following changes to Demac/CanadaPost/Model/Adapter/Abstract.php:

Lines 139 – 143:

$client_options = array(
            'location' => $location,
            'features' => SOAP_SINGLE_ELEMENT_ARRAYS,
            'trace'=>1
        );


TO:

   $client_options = array(
           'location' => $location,
           'features' => SOAP_SINGLE_ELEMENT_ARRAYS,
           'trace' => 1,
           'stream_context' => stream_context_create(
               array(
                   'http' => array(
                       'protocol_version' => 1.0,
                   ),
               )
           ),
        );


Lines 147 – 153:

  $opts = array('ssl' =>
                array(
                    'verify_peer'=> true,
                    'cafile' => $cert,
                    'CN_match' => $this->_location
                )
            );

To:

 $opts = array(
               'ssl' => array(
                   'verify_peer'=> true,
                   'cafile' => $cert,
                   'peer_name' => $this->_location
               ),
               'http' => array(
                   'protocol_version' => 1.0,
               ),
            );

We thank you so much for your support! Please let us know if you have any questions in the comments below.  

Patch:

Steps To Patch Your Magento Canada Post Application:

  1. Download the updated module from here: https://info.demacmedia.com/hubfs/demac-canadapost.zip
  2. Extract the ZIP contents

If you have access to a developer, we strongly recommend you use them to apply these changes. If not, don’t worry! There are two different approaches you can take here:

Method 1 (Easy):

Copy these files from the extracted folder and overwrite them on your website (where the app folder is):

demac-canadapost/app/code/community/Demac/CanadaPost/etc/cert/cacert.pem

demac-canadapost/app/code/community/Demac/CanadaPost/Model/Adapter/Abstract.php

Method 2 (Hard – For a developer):

Step 1) Update the certificate from the extracted ZIP file: demac-canadapost/app/code/community/Demac/CanadaPost/etc/cert/cacert.pem

Step 2) Apply the following changes to Demac/CanadaPost/Model/Adapter/Abstract.php:

Lines 139 – 143:

  $client_options = array(
            'location' => $location,
            'features' => SOAP_SINGLE_ELEMENT_ARRAYS,
            'trace'=>1
        );

TO:

  $client_options = array(
           'location' => $location,
           'features' => SOAP_SINGLE_ELEMENT_ARRAYS,
           'trace' => 1,
           'stream_context' => stream_context_create(
               array(
                   'http' => array(
                       'protocol_version' => 1.0,
                   ),
               )

           ),
        );

Lines 147 – 153:

  $opts = array('ssl' =>
                array(
                    'verify_peer'=> true,
                    'cafile' => $cert,
                    'CN_match' => $this->_location
                )
            );


To:

     $opts = array(
               'ssl' => array(
                   'verify_peer'=> true,
                   'cafile' => $cert,
                   'peer_name' => $this->_location
               ),
               'http' => array(
                   'protocol_version' => 1.0,
               ),
            );
Subscribe to the Blog

Stay updated with 20,000+ eCommerce leaders in our community

Sign Up

Let’s talk about your 10X return

Icon/Social/Phone Contact us for pricing information