This study suggests an energy-scavenging capable unlicensed relay not only to retain communications between an unlicensed sender-recipient pair in underlay cognitive networks but also to secure these communications against eavesdropping of malicious users. Message-securing capability of such a network configuration is assessed through secrecy outage probability (SOP). For this purpose, a precise closed-form formula of the SOP accounting for interference power restriction, Nakagami-m fading, and maximum transmit power restriction is first proposed. Then, the proposed formula is validated by computer simulations. Ultimately, various results are supplied to contrive that the relay position, the time percentage, and the power percentage of the energy-scavenging technique should be appropriately chosen for achieving the best security performance. Moreover, the SOP decreases with lower severity fading level and is constant in the range of high maximum interference power or high maximum transmit power.