Then when he says, if I must boast, he confirms some of the statements made above. Or say that above he speaks about the evils he commendably suffered; but here about the evils he prudently avoided. But because the avoidance of evils that arise against the faith seems to imply weakness, therefore, first, he states that he wishes to glory in those that imply weakness; secondly, he proposes an oath to confirm his statements (v. 31); thirdly, he shows how he avoided some evils (v. 32).
First, therefore, he suggests that the things in which one should glory, if he must glory, saying: If, i.e., be...cause I must, I must boast, I will boast of the things that show my weakness. As if to say: others may glory in their race and other worldly things: "They glory in their shame, with minds set on earthly things" (Phil. 3:19), and I when compelled gloried in them. Yet if I must glory, I will glory in my weakness: "I will all the more gladly boast of my weaknesses, that the power of Christ may rest upon me" (2 Cor. 12:9).
Source: Commentary on 2 Corinthians