We solve the relativistic Riemann problem in viscous matter using the relativistic Boltzmann equation and the relativistic causal dissipative fluid-dynamical approach of Israel and Stewart. Comparisons between these two approaches clarify and point out the regime of validity of second-order fluid dynamics in relativistic shock phenomena. The transition from ideal to viscous shocks is demonstrated by varying the shear viscosity to entropy density ratio $eta/s$. We also find that a good agreement between these two approaches requires a Knudsen number $Kn < 1/2$.