EX-23.1 4 a2140932zex-23_1.htm EX-23.1
QuickLinks -- Click here to rapidly navigate through this document


Exhibit 23.1

CONSENT OF INDEPENDENT ACCOUNTANTS

The Board of Directors
RLI Corp.:

        We consent to the use of our reports incorporated herein by reference in this Registration Statement of RLI Corp. on Form S-8 (relating to the registration of 200,000 RLI Corp. Common Shares for the Nonemployee Directors' Stock Plan).

        Our reports refer to a 2002 change in accounting principle related to adopting the provisions of Statement of Financial Accounting Standards (SFAS) 142, "Goodwill and Other Intangible Assets" and a 2001 change in accounting principle related to adopting the provisions of SFAS 133, "Accounting for Derivative Instruments and Hedging Activities."

/s/ KPMG LLP

Chicago, Illinois
July 26, 2004




QuickLinks