This paper considers the scenario where the base station and legitimate user are blocked by obstacles and uses an intelligent reflecting surface (IRS) to assist communication. To improve physical layer security, we model the eavesdropper channel as the Rican channel and establish a mathematical model with the goal of minimizing eavesdropper's rate subject to eavesdropper's outage probability constraint and legitimate user's secrecy rate constraint. The resulting problem is very challenging due to the continuous angle range of the eavesdropper's outage probability constraint and the coupling constraints imposed by the IRS. We first use a Bernstein-Type inequality to transform the continuous constraints into discrete constraints and then propose an alternating algorithm to obtain a suboptimal solution. Numerical results show that the proposed algorithm can reduce the eavesdropper's communication rate in different cases, which verifies the effectiveness of the proposed algorithm.