Magento2: SSL Breaks Checkout - Magento 2

Created on 1 Jun 2017  路  6Comments  路  Source: magento/magento2

Preconditions

  • Magento 2.1.4 CE
  • CentOS 7-3.1611
  • nginx 1.12.0 (SSL termination only)
  • Varnish 4.1.0
  • Apache 2.4.25
  • PHP 7.0.15
  • MySQL 5.7.17

Steps to reproduce

  1. Configure as above.
  2. Install SSL certificate. (Self-signed for dev. I'm assuming this isn't the problem, but...)
  3. Set Magento to use secure URLs.
  4. Configure Varnish to redirect any http requests to https.
  5. Place items in cart (in the frontend).
  6. Click "Go to Checkout" button (in the frontend).

Expected result

  1. Checkout page should appear.

Actual result

  1. Empty page appears.

More information

Everything seems to work fine with http (non-SSL), but I need to use https for all pages.

When I enable https, everything seems to work fine except the CHECKOUT PAGE IS EMPTY (i.e., the "GET /checkout/" request returns "200 OK" but "Content-Length: 0"). There are no messages in the browser console. I am using a self-signed certificate for development, but it doesn't seem to be causing problems.

If I go to the cart page (/checkout/cart/) first, I get errors in the browser console (which do NOT occur in non-SSL)...

...
VM27901:3 Uncaught TypeError: Cannot read property 'length' of null
    at visible (eval at createBindingsStringEvaluator (knockout.js:2624), <anonymous>:3:83)
    at update (knockout.js:4558)
    at ko.dependentObservable.disposeWhenNodeIsRemoved (knockout.js:3004)
    at evaluateImmediate (knockout.js:1737)
    at ko.subscription.evaluatePossiblyAsync [as callback] (knockout.js:1677)
    at Function.notifySubscribers (knockout.js:1103)
    at Function.observable.valueHasMutated (knockout.js:1300)
    at observable (knockout.js:1285)
    at Object.setShippingRates (shipping-service.js:22)
    at Object.<anonymous> (new-address.js:60)
visible @ VM27901:3
update @ knockout.js:4558
ko.dependentObservable.disposeWhenNodeIsRemoved @ knockout.js:3004
evaluateImmediate @ knockout.js:1737
evaluatePossiblyAsync @ knockout.js:1677
notifySubscribers @ knockout.js:1103
observable.valueHasMutated @ knockout.js:1300
observable @ knockout.js:1285
setShippingRates @ shipping-service.js:22
(anonymous) @ new-address.js:60
fire @ jquery.js:3099
fireWith @ jquery.js:3211
done @ jquery.js:9310
callback @ jquery.js:9720
...

I don't know if this is related, and there are a few more messages (which I can include if they'll be helpful), but the above seems to be the relevant section.

I'm new to Magento, and this is driving me bananas. I'd sure appreciate any expert insight you guys care to offer.

Thanks,
Scott B.

Checkout Format is valid needs update bug report

Most helpful comment

After much pulling of hair and gnashing of teeth, I tried switching to Apache for the SSL termination (eliminating nginx entirely and creating an Apache-Varnish-Apache sandwich). Things seem to work. Why? I don't know, and I'm not sure I care. It _did_ simplify the stack by one component; that's not a bad thing.

I'll say this: I _am_ new to Magento, but I don't suck at this kind of stuff, and this has been by far the hardest installation/configuration I've ever experienced (and that includes installing NetWare 2.0a from 104 5.25" floppy disks back in 1986). I'd s**tcan this whole thing if I didn't have so much time invested in it.

All 6 comments

After much pulling of hair and gnashing of teeth, I tried switching to Apache for the SSL termination (eliminating nginx entirely and creating an Apache-Varnish-Apache sandwich). Things seem to work. Why? I don't know, and I'm not sure I care. It _did_ simplify the stack by one component; that's not a bad thing.

I'll say this: I _am_ new to Magento, but I don't suck at this kind of stuff, and this has been by far the hardest installation/configuration I've ever experienced (and that includes installing NetWare 2.0a from 104 5.25" floppy disks back in 1986). I'd s**tcan this whole thing if I didn't have so much time invested in it.

Hi Brikner,

Is a configure about "Apache for the SSL termination"? I have setup testing environment 2 Apache Web server with Magento 2.0.14, Varnish, Redis and work fine with load test in http condition.

We would like to study implement this setup on production site, so that's a https environment and I see SSL termination can be form a trust channel between 2 web servers and Varnish. But dont know how to configure for this.

Lun

Hi Lun,

I'm going to have to defer your question to more experienced members in this community, if they care to answer you. I'm a Magento novice, and although I _have_ been getting things to work (eventually), I have no idea if I'm doing it "right."

Sorry, but I'd rather give no advice than bad advice.

Scott B.

Hi Scott,

Thanks anyway. You have give me some idea to implement SSL with Varnish.

Lun

@Brikner, thank you for your report.
We were not able to reproduce this issue by following the steps you provided. Please provide more detailed steps to reproduce.

That's as detailed as the steps get. Besides, I solved my problem six months ago. Thanks anyway.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MauroNigrele picture MauroNigrele  路  3Comments

andreaskoch picture andreaskoch  路  3Comments

kandrejevs picture kandrejevs  路  3Comments

jzalenski picture jzalenski  路  3Comments

xi-ao picture xi-ao  路  3Comments