TL;DR
There isn't really a scientific consensus. There appears to be a connection between cortisol and depression, but cortisol anomalies appear neither necessary nor sufficient for depression
The scientific community believed that there is a strong connection between the "happiness hormone" serotonin (5-HT or 5-hydroxytryptamine). This so-called serotonin hypothesis of depression is very simple, in that it claims that a low level of serotonin causes the major depressive disorder. The fact that some antidepressants are selective serotonin reuptake inhibitors (SSRIs) seems to further support this theory.
However, recent findings have shown that impairing serotonin function can cause clinical depression in some circumstances, but is neither necessary nor sufficient.
This was a brief summary of: Cowen, Philip J., and Michael Browning. "What Has Serotonin to Do with Depression?" World Psychiatry 14, no. 2 (2015): 158-60. doi:10.1002/wps.20229.
As a follow up, it has been suggested that elevated levels of the "stress hormone" cortisol lead to decreased 5-HT levels, which in turn leads to depression. This is supported by the reported abnormality of cortisol secretion in MDD patients.
See Dinan, T. G.: Glucocorticoids and the genesis of depressive illness. A psychobiological model. British Journal of Psychiatry, 164 (1994) , 365-371.
However, a study performed in 2002 contradicted this theory:
Cortisol concentrations were not increased in the depressed or vulnerable. Morning salivary and serum cortisol were reduced in depression. Evening cortisol was increased after recent life events. Life events and depression were associated with increased prolactin responses.
Strickland, P. L., Deakin, J. F. W., Percival, C., et al. The bio-social origins of depression in the community. Interactions between social adversity, cortisol and serotonin neurotransmission. British Journal of Psychiatry, 180 (2002),168-173.
On the other hand, a study in 2001 found that MDD is correlated with no response of the serotonin uptake to chronically elevated cortisol levels:
A significant increase in serotonin uptake (+37%+14, M + SD) was observed in the control group, whereas neither the generalized anxiety disorder nor the major depression group exhibited changes in serotonin uptake upon incubation with cortisol. It is likely that under chronic stress or depression, the capacity for increase in serotonin transporter has reached its limit due to the chronically elevated blood cortisol level. The physiological and diagnostic implications of this observation are discussed.
Tafet, G. E., V. P. Idoyaga-Vargas, D. P. Abulafia, J. M. Calandria, S. S. Roffman, A. Chiovetta, and M. Shinitzky. "Correlation between Cortisol Level and Serotonin Uptake in Patients with Chronic Stress and Depression." Cognitive, Affective, & Behavioral Neuroscience 1, no. 4 (2001): 388-93. doi:10.3758/cabn.1.4.388.
An editorial about the former study concludes that
some patients with depression (for example, those reporting recent severe life events) do hypersecrete cortisol. However, elevated cortisol levels after life events are not necessarily associated with the development of depressive disorder. Furthermore, the majority of patients with moderate depression in the community probably do not hypersecrete cortisol. It seems more likely that people with depression in the community exhibit abnormal brain 5-HT function, although the cause of this abnormality requires further study.
Cowen, P. J. "Cortisol, Serotonin and Depression: All Stressed Out?" British Journal of Psychiatry 180, no. 02 (2002): 99-100. doi:10.1192/bjp.180.2.99.
However, a connection between cortisol and depression keeps creeping up:
High cortisol levels lead to arteriosclerosis and thus to coronary artery diseases (CAD), which in turn drastically reduce cortisol levels. Because cortisol is an anti-inflammant, the risk of myocardial infarction and other acute heart diseases increases. Patients with depression and CADs have been found to have the lowest cortisol levels and therefore a very high risks of myocardial infarction.
Waller et al., Blunted Cortisol Stress Response and Depression-induced Hypocortisolism is related to Inflammation in Patients with Coronary Artery Disease, JACC Vol 67 No. 9, Mar 2016