Exhibit 23.1 CONSENT OF INDEPENDENT AUDITORS The Board of Directors and Shareholders RLI Corp.: We consent to incorporation by reference in the registration statements on Form S-8 (Nos. 333-01637 and 333-28625) of RLI Corp. of our reports dated January 10, 2001, relating to the consolidated balance sheets of RLI Corp. and Subsidiaries as of December 31, 2000 and 1999, and the related consolidated statements of earnings and comprehensive earnings, shareholders' equity, and cash flows for each of the years in the three-year period ended December 31, 2000, and all related schedules, which reports are incorporated by reference in, or appear in (with respect to the schedules), the 2000 annual report on Form 10-K of RLI Corp. KPMG LLP Chicago, Illinois March 23, 2001 47