Abstract Using wireless sensor nodes in military operations reduces risks and improves the efficiency of operations, and above all, it minimizes causalities by a large number. Security of sensor nodes is vital and crucial in their deployment and usage in military operations. Verifying the authenticity of sensor nodes is the most desired requirement in applications of wireless sensor networks (WSNs) such as in military to resist various attacks, i.e. replay attack, impersonation attack, ensure forward secrecy and backward secrecy; to reduce the computational and communicational overheads and less consumption of battery power. Here, we propose an efficient and secure authentication protocol for WSNs with context to military applications. Customized digital certificate is used for proving the legitimacy of the sensor nodes. In WSNs, a node is preloaded with the base station’s public key at the time of deployment; it requests and acquires its certificate from the base station and is later used for mutual authentication by sensor nodes. Here, the digital certificate generated and later used by nodes, is customized according to the requirements of military applications. This protocol achieves different security requirements with low computational and communicational overheads. The formal and automated security analysis has been done and proved that the protocol is safe and secure from potential security attacks.