Website ssl and 524 error

The answer lies in your doubt:

Kindly note: 524 error can happen if the origin server is simply taking too long because it has too much work to do or otherwise caused somehow. Here, Cloudflare reaches to your server but the origin fails to respond back in 100s.

Is that SSL encryption mode you are talking about? Suggestion to go for: Full (Strict). You can check this Tutorial

May I suggest you to read the attached articles before further responding