Models of the magnetic field in the solar chromosphere and corona are still mainly based on theoretical extrapolations of photospheric measurements. For the practical calculation of the global field, the so-called source-surface model has been introduced, in which the influence of the solar wind is described by the requirement that the field be radial at some exterior (source) surface. Then the assumption that the field is current-free in the volume between the photosphere and this surface allows for its determination from the photospheric measurement. In the present paper a generalization of the source-surface model to force-free fields is proposed. In the generalized model the parameterα( = ∇ ×B·B/B 2)must be non-constant (or vanish identically) and currents are restricted to regions with closed field lines. A mathematical algorithm for computing the field from boundary data is devised.