Wireless mesh networks (WMNs) have emerged to support applications on various domains, such as military, financial and healthcare, that claim for high level of both security and performance. Since WMNs are susceptible to security issues, and their devices own limitations that can compromise network performance, this paper presents SECOM, a framework for self-configuration of WMNs to provide simultaneously security and performance. It comprises of different functional blocks to manage and adapt network services guaranteeing application requirements. We employ the framework on routing essential service, applying different security mechanisms and redundancies in network and link layers to assist route selection. Simulation results show that our framework enhances both security and performance, with low cost in terms of latency.