A junction box for a solar panel for electrically connecting external connection lines (18a, 18b) to a solar panel, the junction box comprising: a junction box housing mountable to the solar panel; input-side connection elements (32a, 32b) for connecting the voltage-carrying conductors (28a, 28b) of the positive pole and negative pole of the solar panel; output-side connection elements (36a, 36b) for connecting first and second external connection lines (18a, 18b) to the junction box; and a protective circuit that defines an operating state and a protected state, wherein in the operating state, the first external connection line is electrically connected to the voltage-carrying conductor of the positive pole of the solar panel and the second external connection line is electrically connected to the voltage-carrying conductor of the negative pole of the solar panel so that the electrical power produced by the solar panel is delivered via the first and second external connection lines (18a, 18b); wherein the protective circuit comprises a short-circuiting switch between the output-side connection elements (36a, 36b) of the first and second external connection lines (18a, 18b), and an isolating switch; and wherein in the protected state, the short-circuiting switch short-circuits the output-side connection elements (36a, 36b) of the first and second external connection lines (18a, 18b) to each other, and the isolating switch disconnects the short-circuiting switch from the solar panel on at least one side; furthermore comprising a current sensor between one of the external connection lines (18a, 18b) and the short-circuiting switch so that in the protected state it is possible to measure the current flowing in the external connection lines (18a, 18b); characterised in that the protective circuit is configured, when in the protected state, to be responsive to an initial current through the string to switch back from the protected state into the operating state. a junction box housing mountable to the solar panel; input-side connection elements (32a, 32b) for connecting the voltage-carrying conductors (28a, 28b) of the positive pole and negative pole of the solar panel; output-side connection elements (36a, 36b) for connecting first and second external connection lines (18a, 18b) to the junction box; and a protective circuit that defines an operating state and a protected state, wherein in the operating state, the first external connection line is electrically connected to the voltage-carrying conductor of the positive pole of the solar panel and the second external connection line is electrically connected to the voltage-carrying conductor of the negative pole of the solar panel so that the electrical power produced by the solar panel is delivered via the first and second external connection lines (18a, 18b); wherein the protective circuit comprises a short-circuiting switch between the output-side connection elements (36a, 36b) of the first and second external connection lines (18a, 18b), and an isolating switch; and wherein in the protected state, the short-circuiting switch short-circuits the output-side connection elements (36a, 36b) of the first and second external connection lines (18a, 18b) to each other, and the isolating switch disconnects the short-circuiting switch from the solar panel on at least one side; furthermore comprising a current sensor between one of the external connection lines (18a, 18b) and the short-circuiting switch so that in the protected state it is possible to measure the current flowing in the external connection lines (18a, 18b);