We give several general theorems concerning positive definite solutions of Riemann-Hilbert problems on the real line. Furthermore, as an example, we apply our theory to the characteristic function of a class of L\'{e}vy processes and we find the distribution of their extrema at a given stopping time.