Context : Planets orbiting post-common envelope binaries provide fundamental information on planet formation and evolution . We searched for such planets in NN Ser ab , an eclipsing short-period binary that shows long-term eclipse time variations . Using published , reanalysed , and new mid-eclipse times of NN Ser ab obtained between 1988 and 2010 , we find excellent agreement with the light-travel-time effect produced by two additional bodies superposed on the linear ephemeris of the binary . Our multi-parameter fits accompanied by N-body simulations yield a best fit for the objects NN Ser ( ab ) c and d locked in the 2 : 1 mean motion resonance , with orbital periods P _ { \mathrm { c } } \simeq 15.5 yrs and P _ { \mathrm { d } } \simeq 7.7 yrs , masses M _ { \mathrm { c } } \mathrm { sin } i _ { \mathrm { c } } \simeq 6.9 M _ { \mathrm { Jup } } and M _ { \mathrm { d } } \mathrm { sin } i _ { \mathrm { d } } \simeq 2.2 M _ { \mathrm { Jup } } , and eccentricities e _ { \mathrm { c } } \simeq 0 and e _ { \mathrm { d } } \simeq 0.20 . A secondary \chi ^ { 2 } minimum corresponds to an alternative solution with a period ratio of 5 : 2 . We estimate that the progenitor binary consisted of an A star with \sim 2 M _ { \odot } and the present M dwarf secondary at an orbital separation of \sim 1.5 AU . The survival of two planets through the common-envelope phase that created the present white dwarf requires fine tuning between the gravitational force and the drag force experienced by them in the expanding envelope . The alternative is a second-generation origin in a circumbinary disk created at the end of this phase . In that case , the planets would be extremely young with ages not exceeding the cooling age of the white dwarf of 10 ^ { 6 } yrs . Aims : Methods : Results : Conclusions :